* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--background);
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
header {
    background: var(--surface);
    padding: 20px 32px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

header h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 i {
    -webkit-text-fill-color: var(--primary-color);
    background: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info .btn:not(.btn-upload) {
    padding: 0;
    min-width: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info .btn-upload {
    width: auto;
    padding: 10px 20px;
}

/* Auth boxes */
.auth-box {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-width: 440px;
    margin: 80px auto;
    border: 1px solid var(--border);
}

/* Download page */
.download-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.download-box {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    width: 100%;
    border: 1px solid var(--border);
}

.download-header {
    text-align: center;
    margin-bottom: 32px;
}

.download-header i {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.download-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.download-content {
    margin-top: 32px;
}

.file-info-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
}

.file-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 40px;
    color: white;
}

.file-details {
    flex: 1;
}

.file-details h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.file-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.file-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-meta-info i {
    color: var(--primary-color);
}

.download-actions {
    text-align: center;
    margin-bottom: 24px;
}

.btn-download-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.download-info {
    text-align: center;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.download-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-info i {
    color: var(--primary-color);
}

/* Responsive download page */
@media (max-width: 768px) {
    .download-box {
        padding: 32px 24px;
    }
    
    .file-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .file-meta-info {
        justify-content: center;
    }
}

.auth-box h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--surface);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input:hover {
    border-color: #cbd5e1;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    color: var(--text-primary);
    font-size: 14px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox-label span {
    color: var(--text-secondary);
    line-height: 1.5;
}

.file-info {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: #cbd5e1;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-copy {
    background: var(--success);
    color: white;
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* Auth links */
.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    border: 1px solid var(--border);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer .btn {
    width: auto;
}

.modal-small {
    max-width: 500px;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

.toast-info .toast-icon {
    color: var(--primary-color);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

/* Main content */
main {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

section {
    margin-bottom: 48px;
}

section:last-child {
    margin-bottom: 0;
}

section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

section h2 i {
    color: var(--primary-color);
}

.files-section {
    transition: opacity 0.3s ease;
}

/* Upload section */
.upload-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
}

#uploadForm {
    margin-top: 20px;
}

#uploadBtn {
    margin-top: 0;
}

/* Drop zone styling */
.drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.drop-zone-content {
    pointer-events: auto;
}

.drop-zone-content i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.drop-zone-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 8px 0;
}

.drop-zone-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

.drop-zone-hint {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background);
    border-radius: 4px;
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 600;
    position: relative;
}

.upload-time-info {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    align-items: center;
}

.upload-time-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.upload-time-info #uploadPercentText {
    font-weight: 700;
    color: var(--primary-color);
}

#uploadMessage {
    margin-top: 16px;
}

/* Files section */
.no-files {
    text-align: center;
    color: var(--text-secondary);
    padding: 64px 32px;
    font-size: 15px;
}

.no-files i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item-accordion {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
}

.file-item-accordion:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.file-item-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
}

.file-item-header:hover {
    background: var(--background);
}

.file-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.file-item-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.file-item-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s;
    font-size: 14px;
}

.file-item-accordion.active .file-item-arrow {
    transform: rotate(180deg);
}

.file-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.file-item-accordion.active .file-item-content {
    max-height: 1000px;
}

.file-item-details {
    padding: 0 20px 20px 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 0;
}

.file-info h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info h3 i {
    color: var(--primary-color);
}

.file-item-details .file-meta {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.file-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.file-meta span i {
    color: var(--text-secondary);
    font-size: 12px;
}

.file-item-details .file-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-icon {
    padding: 0;
    min-width: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-icon i {
    font-size: 16px;
}

.btn-share {
    background: var(--primary-color);
    color: white;
}

.btn-share:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-download {
    background: var(--primary-color);
    color: white;
}

.btn-download:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-delete {
    background: var(--error);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Share modal */
.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.share-option-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-option-btn i {
    font-size: 32px;
    color: var(--primary-color);
}

.share-option-btn span {
    font-weight: 500;
    font-size: 14px;
}

.share-link-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.share-link-container label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.share-link-input-group {
    display: flex;
    gap: 8px;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
}

/* Email share form */
.email-share-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.email-share-form .form-group {
    margin-bottom: 16px;
}

.email-share-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.email-share-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.share-link {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.share-link:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.share-link:hover {
    border-color: #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .user-info .btn {
        width: 100%;
    }
    
    .auth-box {
        padding: 32px 24px;
        margin: 40px auto;
    }
    
    main {
        padding: 24px 20px;
    }
    
    .user-info {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .user-info .btn-upload {
        width: 100%;
        order: -1;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .share-link {
        width: 100%;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 6px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Settings page */
.settings-main {
    background: var(--surface);
    padding: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.settings-container {
    display: flex;
    min-height: 600px;
}

.settings-sidebar {
    width: 250px;
    background: var(--background);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}

.settings-sidebar h2 {
    padding: 0 24px 24px 24px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.settings-nav-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.settings-nav-item:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.settings-nav-item.active i {
    color: white;
}

.settings-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.settings-section h2 {
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-form {
    max-width: 600px;
}

/* Toggle switch */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-label:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
}

.toggle-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-title {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-description {
    font-size: 13px;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Avatar upload */
.avatar-upload {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    color: var(--text-secondary);
    font-size: 48px;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Password change form */
.password-change-form {
    background: var(--background);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.form-select:hover {
    border-color: var(--primary-color);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Dark mode styles */
.dark-mode {
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

.dark-mode .auth-box,
.dark-mode header,
.dark-mode main,
.dark-mode .modal-content,
.dark-mode .toast,
.dark-mode .file-item-accordion,
.dark-mode .settings-main,
.dark-mode .settings-sidebar,
.dark-mode .settings-content {
    background: var(--surface);
    border-color: var(--border);
}

.dark-mode .drop-zone {
    background: var(--background);
    border-color: var(--border);
}

.dark-mode .drop-zone:hover,
.dark-mode .drop-zone.drag-over {
    background: rgba(99, 102, 241, 0.1);
}

.dark-mode input,
.dark-mode .share-link,
.dark-mode .form-group input,
.dark-mode .form-input,
.dark-mode .form-textarea,
.dark-mode .share-link-input {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .toggle-label {
    background: var(--background);
    border-color: var(--border);
}

.dark-mode .password-change-form {
    background: var(--background);
    border-color: var(--border);
}

/* Crop modal */
.modal-large {
    max-width: 800px;
}

.crop-container {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.crop-container img {
    max-width: 100%;
    display: block;
}

/* Responsive settings */
@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 12px 12px 12px;
    }
    
    .settings-nav-item {
        white-space: nowrap;
        min-width: 120px;
        justify-content: center;
    }
    
    .settings-content {
        padding: 24px 20px;
    }
    
    .avatar-upload {
        flex-direction: column;
        align-items: center;
    }
    
    .avatar-upload-controls {
        width: 100%;
    }
}
