/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Variables */
/* CSS Variables */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Colors - MediClean Pro (Light Default) */
    --text-primary: #014669;
    --text-secondary: #475569;
    --text-accent: #7abcdb;

    /* Colors - MediClean Pro (Light Default) */
    --bg-core: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.9);
    --bg-surface-subtle: #f1f5f9;
    --bg-surface-hover: #e2e8f0;

    --input-bg: #f1f5f9;
    --input-focus-bg: #e2e8f0;

    /* Medical/Clean Gradients */
    --primary-gradient: linear-gradient(135deg, #014669 0%, #7abcdb 100%);
    --secondary-gradient: linear-gradient(135deg, #a6a6a6 0%, #7abcdb 100%);

    --border-light: #a6a6a6;
    --shadow-glow: 0 4px 20px rgba(1, 70, 105, 0.15);

    /* Badges */
    --badge-admin-bg: rgba(1, 70, 105, 0.1);
    --badge-admin-text: #014669;
    --badge-user-bg: rgba(122, 189, 219, 0.1);
    --badge-user-text: #7abcdb;

    --file-card-bg: #ffffff;

    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme overrides */
[data-theme="dark"] {
    --bg-core: #050505;
    --bg-surface: #121212;
    --bg-surface-glass: rgba(18, 18, 18, 0.7);
    --bg-surface-subtle: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: #a6a6a6;
    --text-accent: #7abcdb;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-focus-bg: rgba(255, 255, 255, 0.1);

    --primary-gradient: linear-gradient(135deg, #014669 0%, #7abcdb 100%);
    --secondary-gradient: linear-gradient(135deg, #a6a6a6 0%, #7abcdb 100%);

    --border-light: rgba(166, 166, 166, 0.3);
    --shadow-glow: 0 0 20px rgba(122, 189, 219, 0.2);

    --badge-admin-bg: rgba(1, 70, 105, 0.3);
    --badge-admin-text: #7abcdb;
    --badge-user-bg: rgba(166, 166, 166, 0.1);
    --badge-user-text: #a6a6a6;

    --file-card-bg: rgba(1, 70, 105, 0.2);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



body {
    font-family: var(--font-body);
    background-color: var(--bg-core);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* Utility / Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 9999px;
    /* Pill shape */
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-primary);
}


/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--spacing-md) 0;
    backdrop-filter: blur(10px);
    background: var(--bg-surface-glass);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s ease;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    margin-left: 1rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-surface);
    transform: rotate(15deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    /* Offset fixed header */
    position: relative;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary-gradient);
    filter: blur(150px);
    opacity: 0.2;
    border-radius: 50%;
    top: 10%;
    right: -10%;
    z-index: -1;
    animation: pulse 10s infinite alternate;
}

.hero-bg-glow-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--secondary-gradient);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
    bottom: 0%;
    left: -10%;
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.05em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* Features Grid */
.features {
    padding: var(--spacing-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: var(--spacing-lg);
    border-radius: 16px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--text-accent);
    box-shadow: var(--shadow-glow);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.card p {
    color: var(--text-secondary);
}

/* Authentication Forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-card {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 12px;
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--text-accent) !important;
    background: var(--input-focus-bg) !important;
}

.error-message {
    color: #ef4444;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 1.5em;
    font-size: 0.9rem;
}

.success-message {
    color: #10b981;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.link {
    text-align: center;
    display: block;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.link a {
    color: var(--text-accent);
    text-decoration: underline;
}

/* Admin Dashboard Styles */
.admin-header {
    padding-top: 100px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface-subtle);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin-top: 1rem;
}

.user-table th,
.user-table td {
    text-align: left;
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-light);
}

.user-table th {
    background: var(--bg-surface-hover);
    font-weight: 600;
    color: var(--text-primary);
}

.user-table tr:hover {
    background: var(--bg-surface-hover);
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-admin {
    background: var(--badge-admin-bg);
    color: var(--badge-admin-text);
    border: 1px solid var(--badge-admin-bg);
}

.badge-user {
    background: var(--badge-user-bg);
    color: var(--badge-user-text);
    border: 1px solid var(--badge-user-bg);
}

.action-btn {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.action-btn:hover {
    background: #ef4444;
    color: #fff;
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* File Explorer Styles */
.file-explorer {
    padding-top: 100px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    min-height: 80vh;
}

.sidebar {
    background: var(--bg-surface-subtle);
    border-right: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

.folder-list li {
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.folder-list li:hover {
    background: var(--bg-surface-hover);
}

.folder-list li.active {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .folder-list li.active {
    color: var(--text-accent);
    background: rgba(124, 58, 237, 0.1);
}

.folder-locked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

.file-card {
    background: var(--file-card-bg);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.file-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-accent);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.file-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.download-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-surface-subtle);
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: var(--text-accent);
    background: var(--bg-surface-hover);
}


/* Footer */
footer {
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: var(--spacing-xl);
}

/* Animation Keyframes */
@keyframes pulse {
    0% {
        opacity: 0.15;
        transform: scale(0.8);
    }

    100% {
        opacity: 0.25;
        transform: scale(1.1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
        /* simple mobile hide for now */
    }

    .admin-header,
    .file-explorer {
        display: block;
    }

    .file-explorer {
        grid-template-columns: 1fr;
    }
}

/* Animation Utilities */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.toast.toast-success {
    border-left: 4px solid #10b981;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-in forwards;
}