:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #a5b4fc;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #111827;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #f97316 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-800);
    padding-top: 80px ;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 16px;
    letter-spacing: -0.01em;
}

html, body {
    height: 100% ;
    scroll-behavior: smooth ; /* Smoothly scroll down for <a> */
}

/* Glass Morphism */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    height: 5rem ;
}

header .logo img {
    height: 45px;
    transition: var(--transition);
}

header .logo img:hover {
    transform: scale(1.05);
}

header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

header nav a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

header nav a:hover {
    color: var(--primary);
    background: var(--gray-50);
    transform: translateY(-1px);
}

header nav a:before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

header nav a:hover:before {
    width: 80%;
}

#logout {
    background: var(--gradient-primary);
    color: white !important;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

#logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    /* background: var(--primary-dark); */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(79, 70, 229, 0.05);
    border-radius: var(--border-radius) ;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.user-avatar {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.user-info span {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.9rem;
}

footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%) ;
    color: white ;
    text-align: center ;
    padding: 3rem 2rem 2rem ;
    margin-top: 4rem ;
    position: relative ;
    overflow: hidden ;
    flex-shrink: 0 ; /* Fixed footer by avoid shrinking */
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
}

footer .logo img {
    height: 35px;
    margin-bottom: 2.5rem;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

footer .logo img:hover {
    transform: scale(1.1);
}

footer ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

footer ul li a {
    text-decoration: none;
    color: var(--gray-300);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 6px;
}

footer ul li a:hover {
    color: var(--primary-light);
    transform: translateY(-2px);
}

footer p.copyright {
    color: var(--gray-400);
    font-size: 0.9rem;
    opacity: 0.8;
}

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

.hero {
    text-align: center;
    background: var(--gradient-primary);
    color: white;
    padding: 5rem 3rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius) ;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.hero .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Enhanced Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 0.95);
}

.card h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
    font-weight: 700;
}

.card p {
    color: var(--gray-600);
    line-height: 1.7;
    font-size: 1rem;
}

.stats-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.stats-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    padding: 2px;
    background: var(--gradient-primary);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude; /* Overlapping parts of gradients are excluded. WHILE non-overlapping parts are visible */
    pointer-events: none;
}

.stats-card h2 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 800;
}

.stats-text {
    font-size: 1.2rem;
    font-family: 'Arial', sans-serif;
    font-weight: 500;
    color: #333;
    text-align: center;
    margin: 2rem 0;
    line-height: 1.6;
    background: linear-gradient(135deg, #6b7dff, #a5b4f5);
    -webkit-background-clip: text;
    color: transparent;
    padding: 1rem 0;
    position: relative;
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.stats-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    z-index: -1;
    filter: blur(4px);
}

.stats-text:hover {
    transform: translateY(-5px);
    color: #4c6ef5;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 3rem 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 3.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.auth-card h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    font-size: 2.2rem;
    font-weight: 800;
}

.auth-card > p {
    color: var(--gray-600);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-text {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--gray-600);
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input {
    margin-right: 0.75rem;
    width: auto;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary {
    width: 100%;
}

.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.upload-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-section h2 {
    color: var(--gray-800);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.upload-form {
    max-width: 600px;
    margin: 0 auto;
}

.upload-info {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    color: var(--gray-700);
    font-size: 0.95rem;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.upload-info ul {
    list-style: disc;
    margin-left: 1.5rem;
    padding-left: 0.5rem;
}

.upload-info li {
    margin-bottom: 0.35rem;
    color: var(--gray-800);
}

label[for="files"].drag-over {
    border: 2px dashed var(--primary-color);
    background-color: var(--primary-light) ;
}

.upload-info:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-md);
}

.upload-info li:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    border-radius: var(--border-radius) ;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
    cursor: pointer ;
}

.upload-area {
    position: relative;
    margin-bottom: 2rem;
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-area label {
    display: block;
    padding: 4rem 3rem;
    border: 3px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.upload-area label:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.upload-area p {
    font-size: 1.2rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.upload-area small {
    color: var(--gray-500);
    font-size: 1rem;
}

.uploads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.uploads-grid.vertical {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-card.upload-row {
    display: flex;
    padding: 1.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.upload-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.upload-thumb {
    flex: 0 0 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid var(--gray-100);
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.upload-thumb:hover img {
    transform: scale(1.05);
}

.upload-details {
    flex: 1;
    padding: 0 1rem;
}

.upload-details h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    word-break: break-word;
    color: var(--gray-800);
    font-weight: 600;
}

.upload-details .upload-date,
.upload-details .upload-size {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.account-header {
    text-align: center;
    margin-bottom: 4rem;
}

.account-header h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.account-header > p {
    color: var(--gray-600);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Enhanced Error Page */
.error-page {
    text-align: center;
    padding: 5rem 3rem;
    background: rgba(239, 68, 68, 0.05);
    border: 2px solid rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
    backdrop-filter: blur(20px);
}

.error-page h1 {
    color: var(--danger);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.error-page p {
    font-size: 1.3rem;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
}

.error-page .btn {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.alert {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    font-size: 1rem;
    z-index: 9999;
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.5s ease-in-out;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border-left: 4px solid var(--secondary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-out {
    opacity: 0;
    transform: translateX(100px);
}

.no-uploads {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.no-uploads h2 {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.no-uploads p {
    color: var(--gray-500);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.div-loader {
    position: fixed ;
    top: 110px ;
    left: 10px ;
    /* height: 100vh ; */
    /* width: 100% ; */
    background-color: rgba(255, 255, 255, 0.7) ;
    z-index: 10 ;
}

.loader {
    border: 4px solid #c6c6c6;
    border-radius: 50%;
    border-top: 3px solid var(--primary); 
    width: 3rem;
    height: 3rem;
    animation: spin 2s linear infinite;
    z-index: 11 ;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 3rem 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .auth-card {
        margin: 0 1rem;
        padding: 2.5rem;
    }
    
    .uploads-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .upload-area label {
        padding: 3rem 1.5rem;
    }
    
    .upload-card.upload-row {
        flex-direction: column;
        text-align: center;
    }
    
    .upload-buttons {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    header {
        padding: 1rem;
    }
    
    header nav {
        gap: 1rem;
    }
    
    .user-info {
        margin-left: 0.5rem;
        padding: 0.4rem 0.8rem;
    }
    
    .user-info span {
        display: none;
    }
    
    .account-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .account-header h1 {
        font-size: 2rem;
    }
    
    header nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}