/* =================================================================== */
/* ====               Reset and Base Styles                       ==== */
/* =================================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* =================================================================== */
/* ====               Header & Navigation (Desktop)               ==== */
/* =================================================================== */

.header {
    background: white;
    border-bottom: 2px solid #22c55e;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background-color: #22c55e;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.tagline {
    font-size: 0.875rem;
    color: #6b7280;
    display: none;
}

@media (min-width: 640px) {
    .tagline {
        display: inline;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.nav-link:hover,
.nav-link.active {
    color: #22c55e;
    background-color: rgba(34, 197, 94, 0.1);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-buttons .btn-ghost {
    padding: 0.5rem 1rem;
    text-decoration: none !important;
}

.auth-buttons .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    text-decoration: none;
}

/* --- User Menu (Desktop) --- */
.user-menu {
    position: relative;
}

.user-avatar {
    cursor: pointer;
    transition: transform 0.2s;
    width: 2rem;
    height: 2rem;
    background-color: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}
.user-avatar-button:hover .user-avatar {
    transform: scale(1.08);
}
.user-avatar.large {
    width: 3rem;
    height: 3rem;
    font-size: 1.2rem;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem); /* Position below the avatar with a gap */
    right: 0;
    width: 260px; /* A fixed, generous width */
    background: white;
    border-radius: 0.75rem; /* Slightly larger radius */
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    z-index: 100;
    overflow: hidden; /* Ensures child elements conform to border-radius */
    
    /* Animation for appearing */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none; /* Prevents interaction when hidden */
}
/* Show the dropdown when the style is changed to display: block */
.user-dropdown[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* The header of the dropdown */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.user-info {
    padding: 0;
    overflow: hidden; /* Prevent long names/emails from breaking layout */
}

.user-name {
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The section for action items */
.dropdown-section {
    padding: 0.5rem;
}

.dropdown-divider {
    height: 1px;
    background-color: #f3f4f6; /* Lighter divider */
    margin: 0;
}

/* Individual action items */
.dropdown-item {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.dropdown-icon {
    width: 16px;
    text-align: center;
    color: #9ca3af;
}

.dropdown-item:hover .dropdown-icon {
    color: #374151;
}

/* Danger item styling */
.dropdown-item.danger-item {
    color: #ef4444; /* Red text */
}

.dropdown-item.danger-item:hover {
    background-color: #fef2f2; /* Light red background */
    color: #b91c1c; /* Darker red on hover */
}

.dropdown-item.danger-item .dropdown-icon {
    color: #ef4444;
}

.dropdown-item.danger-item:hover .dropdown-icon {
    color: #b91c1c;
}

.user-avatar-button {
    background: none;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: block; 
}
.user-avatar-button:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}


.user-info {
    padding: 1rem;
}

.user-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.75rem;
    color: #6b7280;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* --- Mobile Menu --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #22c55e;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
}

.mobile-menu-wrapper {
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}


/* =================================================================== */
/* ====                General Components & Forms                 ==== */
/* =================================================================== */

.btn-primary {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #16a34a;
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
    text-decoration: none !important;
}

.btn-ghost:hover {
    color: #22c55e;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* =================================================================== */
/* ====                   Main Content Sections                   ==== */
/* =================================================================== */

.main {
    padding: 2rem 0;
}

.section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.files-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

.stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.stats strong {
    color: #22c55e;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- Upload Section --- */
.upload-card {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-card:hover {
    border-color: #1cb353;
    background-color: rgba(34, 197, 94, 0.02);
}

.upload-card.drag-hover {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.05);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.upload-content {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: #22c55e;
}

.upload-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.file-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.file-type {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.file-limit {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

/* --- Upload Progress --- */
.upload-progress {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.upload-progress h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.progress-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-filename {
    font-weight: 500;
    flex: 1;
    margin-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: #22c55e;
    transition: width 0.3s ease;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.progress-text {
    color: #6b7280;
}

.progress-id {
    font-family: 'Monaco', 'Menlo', monospace;
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* --- Recent Uploads List --- */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f3f4f6;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    /* Fix for flexbox overflow */
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    flex-shrink: 0;
}

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

.file-details h5 {
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    background-color: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: #22c55e;
    font-weight: 500;
}

/* --- Admin Section (Desktop Table) --- */
.admin-files {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
    font-weight: 600;
    color: #6b7280;
    background-color: #f9fafb;
}

.admin-table tr:hover {
    background-color: #f9fafb;
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    flex-direction: row;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-input input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.search-input input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-bar-select-wrapper {
    position: relative;
    width: fit-content;
}

.search-bar-select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 130px;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    color: #111827;
    cursor: pointer;
}

.search-bar-select-wrapper select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-bar-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor' aria-hidden='true'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd' fill='%236B7280'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
}

/* Desktop Styles for Search Bar */
@media (min-width: 769px) {
    .search-bar {
        flex-direction: row;
        gap: 1rem;
    }

    .search-bar-select-wrapper select {
        min-width: 12rem;
    }

    .search-bar-select-wrapper {
        width: fit-content;
    }

}


/* =================================================================== */
/* ====               Modals & Notifications                      ==== */
/* =================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.modal-close:hover {
    background-color: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-actions button {
    flex: 1;
}

/* --- QR Modal --- */
.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.qr-code {
    width: 12rem;
    height: 12rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-info {
    margin-bottom: 1.5rem;
}

.qr-info code {
    font-family: 'Monaco', 'Menlo', monospace;
    background-color: #f3f4f6;
    color: #22c55e;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.qr-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* --- Toast Popdown Notifications --- */
.toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    width: 90%;
    max-width: 450px;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #22c55e;
    animation: popdown 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.toast.fade-out {
    animation: slideup 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error .toast-title {
    color: #ef4444;
}

.toast-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #111827;
}

.toast-message {
    font-size: 0.875rem;
    color: #6b7280;
}

@keyframes popdown {
    from {
        opacity: 0;
        transform: translateY(-150%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideup {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-150%);
    }
}

.mobile-manager-link-wrapper {
    display: none;
}

/* ==== Responsive (Mobile) Styles ==== */

@media (max-width: 768px) {

    /* --- Body Lock for Active Menu --- */
    body.menu-active {
        overflow: hidden;
        /* Prevents background from scrolling */
    }

    /* --- Base Mobile Layout --- */
    .container {
        padding: 0 0.9rem;
    }

    .header-content {
        flex-wrap: nowrap;
        padding-right: 0.5rem;
    }

    .tagline {
        display: none;
    }

    /* ==== Mobile Menu Styles ==== */

    .mobile-menu-toggle {
        display: block;
        z-index: 1001;
        position: relative;
    }

    .mobile-menu-wrapper {
        display: flex;
        position: fixed;
        top: 0;
        right: -300px; /* Hidden off-screen to the right */
        width: 300px;  /* Fixed width like the example */
        max-width: 80%; /* Safety for very small screens */
        height: 100%;
        background-color: #ffffff;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 1.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
        transform: none; /* Reset transform from previous implementation */
        transition: right 0.35s ease-in-out; /* Animate the 'right' property */
    }

    .mobile-menu-wrapper.active {
          right: 0;
    }

    /* --- Navigation Links Section --- */
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        padding: 0;
        border: none;
    }

    .nav-link {
        width: 100%;
        padding: 0.8rem 1rem;
        justify-content: flex-start;
        font-size: 1rem;
        font-weight: 500;
        color: #374151;
        border-radius: 0.5rem;
    }

    .nav-link.active,
    .nav-link:hover {
        color: #16a34a;
        background-color: #f0fdf4;
    }

    .nav-link span {
        display: inline;
    }

   .nav-link, #toggleView, .dropdown-item {
        width: 100%;
        padding: 0.8rem 1rem;
        justify-content: flex-start;
        font-size: 1rem;
        font-weight: 500;
        color: #374151;
        border-radius: 0.5rem;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        background: none;
        border: none;
        cursor: pointer;
    }
    .nav-link i, #toggleView i, .dropdown-item i {
        width: 20px; /* Align icons nicely */
        text-align: center;
        color: #9ca3af;
    }

    .nav-link.active, .nav-link:hover,
    #toggleView:hover, .dropdown-item:hover {
        color: #16a34a;
        background-color: #f0fdf4;
    }

    .nav-link.active i, .nav-link:hover i,
    #toggleView:hover i, .dropdown-item:hover i {
        color: #16a34a;
    }

    .dropdown-item.danger-item, .dropdown-item.danger-item:hover {
        color: #ef4444;
        background-color: #fef2f2;
    }
    .dropdown-item.danger-item i, .dropdown-item.danger-item:hover i {
        color: #ef4444;
    }

    /* --- Admin & User Section (pushes user info to bottom) --- */
    .header-actions {
  display: contents;
    }

    #toggleView {
        justify-content: flex-start;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        font-weight: 500;
        border-radius: 0.5rem;
        color: #374151;
    }

    #toggleView:hover {
        background-color: #f3f4f6;
    }

    .user-menu {
        position: static;
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .user-dropdown {
        position: static;
        display: block !important;
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        background: none;
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0;
        margin: 0;
    }

    .user-avatar {
        display: flex !important;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .user-name {
           font-size: 1rem;
        font-weight: 600;
        color: #111827;
        margin: 0;
    }

    .user-email {
          font-size: 0.8rem;
        color: #6b7280;
    }

    .dropdown-divider {
         display: none;
    }

    .dropdown-item {
        justify-content: flex-start;
        font-size: 1rem;
        padding: 0.8rem 1rem;
        border-radius: 0.5rem;
    }

    .auth-buttons {
 flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: auto; /* Push auth buttons to the bottom */
        padding-top: 1.5rem;
        border-top: 1px solid #e5e7eb;
    }

    .auth-buttons .btn-ghost,
    .auth-buttons .btn-primary {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
        justify-content: center;
    }

    .auth-buttons span {
        display: inline;
    }

    /* --- Main Content (Mobile) --- */
    .main {
        padding: 1.5rem 0;
    }

    .section {
        gap: 0.5rem;
    }

    .upload-card {
        padding: 1.5rem;
    }

    .upload-card h3 {
        font-size: 1.1rem;
    }

    .upload-card p {
        font-size: 0.9rem;
    }

    .files-card {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .recent-upload-card-header {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 8rem;
        margin-bottom: 1rem;
    }

    .card-header .recent-upload-card-header h4 {
        font-size: 1rem;
    }

    /* Keep your custom .stats styling */
    .stats {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.8rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .file-actions {
        width: 100%;
        justify-content: space-around;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    /* --- Admin File Management (Mobile Card View) --- */
    .admin-table {
        display: none !important;
    }

    /* Goto Admin file manaer button*/

    .mobile-manager-link-wrapper {
        display: block;
        /* Make the wrapper visible */
        margin-top: 1.5rem;
        /* Add some space above it */
    }

    .mobile-manager-link-wrapper .btn-primary {
        width: 100%;
        /* Make the button full-width */
        justify-content: center;
        /* Center the icon and text */
        padding: 0.8rem;
        /* Use the same padding as other mobile buttons */
        font-size: 1rem;
    }


    /* Apply your custom stats styling for the Admin section */
    #adminSection .stats {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 13.9px;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-bottom: 2px dotted #1da04d;
    }

    .mobile-file-header {
        display: flex;
        justify-content: space-between;
        padding: 0 0.5rem 0.5rem 0.5rem;
        font-weight: 600;
        font-size: 0.8rem;
        color: #6b7280;
        text-transform: uppercase;
    }

    .mobile-file-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .mobile-file-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: white;
        padding: 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }

    .mobile-file-card .file-icon {
        background-color: #f0fdf4;
        width: 2.25rem;
        height: 2.25rem;
    }

    .mobile-file-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        overflow: hidden;
    }

    .mobile-file-info h5 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-file-info .file-details {
        overflow: hidden;
    }

    .action-menu-trigger {
        background: transparent;
        border: none;
        color: #6b7280;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        width: 32px;
        height: 32px;
    }

    .action-menu-trigger:hover {
        background-color: #f3f4f6;
        color: #111827;
    }

    .file-action-menu {
        position: fixed;
        background-color: white;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1010;
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        border: 1px solid #e5e7eb;
        min-width: 180px;
    }

    .file-action-item {
        background: none;
        border: none;
        text-align: left;
        padding: 0.6rem 0.75rem;
        cursor: pointer;
        border-radius: 0.375rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.875rem;
        color: #374151;
    }

    .file-action-item:hover {
        background-color: #f3f4f6;
    }

    .file-action-item.action-delete {
        color: #ef4444;
    }

    .file-action-item.action-delete:hover {
        background-color: #fef2f2;
    }

    .action-menu-divider {
        height: 1px;
        background-color: #e5e7eb;
        margin: 0.5rem 0;
    }

    /* --- Modals (Mobile) --- */
    .modal-content {
        max-width: 95%;
        width: auto;
        margin: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions button {
        padding: 0.8rem;
    }
}