:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-color: #0f172a;
    --dark-secondary: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 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);
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --transition: all 0.2s ease;
}

.selected-file {
    background-color: #eef2ff;
    border-radius: var(--radius-lg);
}

.grid-dir-object {
    max-width: 128px;
    text-align: center;
    font-size: 0.85rem;
}

.drop-zone.hover {
    background-color: #eef2ff;
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-xl);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.landing-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.landing-nav .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-nav .nav-link {
    color: var(--gray-300) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
}

.landing-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}

.hero-section {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-300);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    color: white;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: white;
}

.btn-hero-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    color: white;
    transition: var(--transition);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.features-section {
    padding: 6rem 0;
    background: var(--gray-50);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-500);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.feature-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.feature-icon.primary {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: var(--primary-color);
}

.feature-icon.secondary {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    color: var(--secondary-color);
}

.feature-icon.accent {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: var(--accent-color);
}

.feature-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 0;
}

.stats-section {
    background: var(--gradient-hero);
    padding: 5rem 0;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-300);
}

.cta-section {
    padding: 6rem 0;
    background: white;
}

.cta-box {
    background: var(--gradient-hero);
    border-radius: var(--radius-2xl);
    padding: 4rem;
    text-align: center;
    color: white;
}

.cta-box h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-box p {
    color: var(--gray-300);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.landing-footer {
    background: var(--dark-color);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 2rem;
    margin-top: 3rem;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h2 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.form-floating > label {
    color: var(--gray-500);
}

.form-control {
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--gray-400);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

.app-layout {
    background: var(--gray-100);
    min-height: 100vh;
}

.app-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
}

.app-nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-100);
}

.app-nav-link.active {
    color: var(--primary-color);
    background: #eef2ff;
}

.storage-dropdown {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: var(--gray-700);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.storage-dropdown:hover {
    background: var(--gray-200);
}

.app-content {
    padding: 1.5rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.media-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.media-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.media-item.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.media-item-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    overflow: hidden;
}

.media-item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.media-item-name {
    font-size: 0.85rem;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-bar {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.upload-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.upload-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-box {
        padding: 2rem;
    }
    
    .cta-box h2 {
        font-size: 1.5rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
}
