/* Dashboard Layout */
:root {
    --sidebar-width: 280px;
    --right-sidebar-width: 320px;
    --header-height: 70px;
    --primary: #2E3093;
    --primary-light: #4c4ebd;
    --bg-main: #f8fafc;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--gray-800);
    overflow-x: hidden;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--gray-500);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--gray-100);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--right-sidebar-width);
    padding: 2rem;
    min-width: 0;
    /* Prevent flex overflow */
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--gray-200);
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--gray-200);
    border-radius: 50%;
    overflow: hidden;
}

/* Right Sidebar */
.right-sidebar {
    width: var(--right-sidebar-width);
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    padding: 2rem;
    position: fixed;
    right: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Dashboard Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.content-section {
    background: var(--white);
    border-radius: 1.5rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    overflow: hidden;
}

.content-section:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

/* Mobile Responsiveness */
.mobile-header {
    display: none;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 90;
    justify-content: space-between;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
}

@media (max-width: 1200px) {
    .right-sidebar {
        display: none;
    }

    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .mobile-header {
        display: flex;
    }
}

/* Utilities */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-100);
}

/* Profile Section */
.profile-container {
    max-width: 800px;
}

.profile-upload-group {
    position: relative;
    width: fit-content;
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    overflow: hidden;
    border: 4px solid var(--gray-100);
    background: var(--gray-50);
}

.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-label {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 4px solid white;
    transition: transform 0.2s;
}

.upload-label:hover {
    transform: scale(1.1);
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 100px;
}

.badge-primary {
    background: var(--primary-light);
    color: white;
}

.badge-success {
    background: #ecfdf5;
    color: #10b981;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background: white;
    color: var(--gray-800);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

/* Collapsible Sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    padding: 2rem 2.5rem;
    background: #fff;
    border-left: 4px solid transparent;
}

.collapsible-header:hover {
    background-color: #fafbfc;
}

.collapsible-header.active {
    background-color: #f8fafc;
    border-left-color: var(--primary);
}

.collapsible-header .header-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.collapsible-header .icon-box {
    width: 44px;
    height: 44px;
    background: var(--gray-50);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.collapsible-header.active .icon-box {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 48, 147, 0.2);
}

.collapsible-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.collapsible-header .chevron {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--gray-400);
    width: 20px;
    height: 20px;
}

.collapsible-header.active .chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.collapsible-content {
    padding: 0 2.5rem 2.5rem 2.5rem;
    border-top: 1px solid var(--gray-100);
    background: #fff;
}

/* Image Manager */
.album-card {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.album-header {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 1.75rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gray-50);
}

.photo-item.is-cover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 48, 147, 0.1), 0 8px 16px rgba(46, 48, 147, 0.15);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 0.75rem;
    z-index: 5;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.cover-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.remove-photo {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.remove-photo:hover {
    background: #ef4444;
    transform: scale(1.15) rotate(90deg);
}

.set-cover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-900);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.set-cover:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Animations */
[x-cloak] {
    display: none !important;
}

@media (max-width: 768px) {

    .collapsible-header,
    .collapsible-content {
        padding: 1.5rem;
    }
}