/* ========================================
   ANAND SHARE - Modern UI/UX Design
   ======================================== */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --primary-soft: #a5b4fc;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.12);
    
    --warning: #f59e0b;
    
    /* Neutrals */
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Text */
    --text: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Login Screen
   ======================================== */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-circle i {
    color: white;
    font-size: 28px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--bg);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* ========================================
   App Layout
   ======================================== */

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--surface);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-brand i {
    color: var(--primary);
    font-size: 22px;
}

.header-brand span {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Main Section */
.main-section {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-header {
    padding: 20px 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.receive-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.send-icon {
    background: var(--success-light);
    color: var(--success);
}

.dash-icon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.header-text {
    flex: 1;
}

.header-text h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.header-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.card-body {
    padding: 20px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 15px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Input Styles
   ======================================== */

.code-input-wrapper {
    margin-bottom: 16px;
}

#receive-code {
    width: 100%;
    padding: 18px;
    font-size: 28px;
    text-align: center;
    letter-spacing: 12px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    transition: all 0.2s;
}

#receive-code:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-light);
}

#receive-code::placeholder {
    letter-spacing: 12px;
    color: var(--text-tertiary);
}

/* ========================================
   File Preview
   ======================================== */

.file-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.file-icon-large {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-details h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

.password-input input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 12px;
}

.password-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .btn {
    flex: 1;
}

/* ========================================
   Upload Zone
   ======================================== */

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--surface);
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 1;
}

.upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.upload-buttons .btn {
    flex: 1;
    max-width: 140px;
}

/* ========================================
   Options Section
   ======================================== */

.options-section {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.options-section details[open] summary {
    border-bottom: 1px solid var(--border);
}

.options-section summary {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    background: var(--bg);
}

.options-section summary::-webkit-details-marker {
    display: none;
}

.options-section summary i:first-child {
    color: var(--text-secondary);
}

.options-section summary i:last-child {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.options-section details[open] summary i:last-child {
    transform: rotate(180deg);
}

.options-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
}

.option-row {
    display: flex;
    gap: 16px;
}

.option-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-item.full {
    flex: 100%;
}

.option-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-input,
.text-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
}

.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--success);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ========================================
   Progress Section
   ======================================== */

.progress-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

.progress-track {
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #818cf8 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   Result Section
   ======================================== */

.result-section {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    margin-top: 16px;
}

.result-icon {
    font-size: 48px;
    color: var(--success);
    margin-bottom: 8px;
}

.result-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.qr-container {
    margin-bottom: 20px;
}

.qr-image {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-md);
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--surface);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.code-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--primary);
    font-family: 'SF Mono', Monaco, monospace;
}

.link-display {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--surface);
}

.expiry-text {
    font-size: 13px;
    color: var(--warning);
    font-weight: 600;
    margin-bottom: 16px;
}

/* ========================================
   Status & Error
   ======================================== */

.status-body {
    text-align: center;
    padding: 32px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-banner {
    margin: 0 20px 20px;
    padding: 12px 16px;
    background: var(--error-light);
    color: var(--error);
    border-radius: var(--radius-md);
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

/* ========================================
   Dashboard Table
   ======================================== */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.data-table td {
    padding: 14px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--border);
}

/* ========================================
   Utilities
   ======================================== */

.hidden {
    display: none !important;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }

/* ========================================
   Responsive - Desktop
   ======================================== */

@media (min-width: 768px) {
    .main-section {
        padding: 32px 24px;
    }
    
    .card {
        border-radius: var(--radius-xl);
    }
    
    .card-header {
        padding: 24px 24px 0;
    }
    
    .card-body {
        padding: 24px;
    }
    
    .upload-zone {
        padding: 56px 32px;
    }
    
    .upload-icon {
        font-size: 56px;
    }
    
    .code-value {
        font-size: 36px;
    }
}

@media (min-width: 1024px) {
    .app-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        max-width: 960px;
        margin: 0 auto;
        padding: 32px 24px;
    }
    
    .app-header {
        grid-column: 1 / -1;
        border-radius: var(--radius-lg);
    }
    
    .main-section {
        padding: 0;
    }
    
    .card {
        max-width: none;
    }
}

/* ========================================
   Responsive - Small Mobile
   ======================================== */

@media (max-width: 380px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-circle i {
        font-size: 24px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .code-value {
        font-size: 24px;
        letter-spacing: 4px;
    }
    
    #receive-code {
        font-size: 22px;
        letter-spacing: 8px;
    }
    
    .upload-buttons {
        flex-direction: column;
    }
    
    .upload-buttons .btn {
        max-width: none;
    }
    
    .option-row {
        flex-direction: column;
    }
}
