/**
 * DASHBOARD.CSS - Festive Photo-Oriented Design
 */

:root {
    --teal: #0d9488;
    --teal-light: #ccfbf1;
    --teal-dark: #0f766e;
    --orange: #f97316;
    --coral: #f97068;
    --warm-cream: #faf8f5;
    --warm-shadow: rgba(180, 140, 100, 0.08);
    --dark: #1a1a2e;
    --border: #e8e4df;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--warm-cream);
    color: var(--dark);
    min-height: 100vh;
}

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

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon { font-size: 1.5rem; }

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-item:hover { background: #f1f5f9; color: var(--dark); }
.nav-item.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }

.nav-icon { font-size: 1.25rem; }

/* Nav Group & Submenu */
.nav-group { margin-bottom: 0.25rem; }
.nav-toggle { position: relative; }

.nav-arrow {
    margin-left: auto;
    font-size: 1rem;
    transition: transform 0.2s;
    color: #888;
}

.nav-toggle.open .nav-arrow { transform: rotate(90deg); }

.nav-badge {
    background: var(--teal);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.nav-toggle .nav-badge { margin-left: 0; margin-right: 0.5rem; }

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 1rem;
}

.nav-submenu.open { max-height: 200px; }

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.875rem;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.125rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.nav-subitem:hover { background: #f1f5f9; color: var(--dark); }
.nav-subitem.active { background: var(--teal-light); color: var(--teal); font-weight: 500; }
.nav-subitem .nav-icon { font-size: 1rem; }

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
}

.nav-item.logout:hover { background: #fee2e2; color: #dc2626; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

button.nav-item {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

/* ===== Main ===== */
.main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-menu { position: relative; }

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover { border-color: var(--teal); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name { font-weight: 500; font-size: 0.9rem; }
.chevron { font-size: 0.7rem; color: #888; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-header strong { display: block; }
.dropdown-header span { font-size: 0.85rem; color: #666; }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover { background: var(--warm-cream); }
.dropdown-item .badge {
    margin-left: auto;
    background: var(--teal-light);
    color: var(--teal);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.text-danger { color: #dc2626 !important; }

.content { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* Alert */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 1.5rem 0;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

/* ===== Hero Welcome Banner ===== */
.hero-banner {
    position: relative;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
    color: white;
}

.hero-gradient-default { background: linear-gradient(135deg, #0d9488 0%, #f97316 100%); }
.hero-gradient-travel { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.hero-gradient-birthday { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.hero-gradient-wedding { background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); }
.hero-gradient-family { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.hero-gradient-friends { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.hero-gradient-evjf { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.hero-gradient-evg { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.hero-gradient-graduation { background: linear-gradient(135deg, #0d9488 0%, #667eea 100%); }
.hero-gradient-holidays { background: linear-gradient(135deg, #f5576c 0%, #ff9a9e 100%); }
.hero-gradient-festival { background: linear-gradient(135deg, #f97316 0%, #f5576c 100%); }
.hero-gradient-weekend { background: linear-gradient(135deg, #a8edea 0%, #4facfe 100%); }
.hero-gradient-baby { background: linear-gradient(135deg, #fad0c4 0%, #a8edea 100%); }
.hero-gradient-sport { background: linear-gradient(135deg, #0d9488 0%, #4facfe 100%); }
.hero-gradient-corporate { background: linear-gradient(135deg, #667eea 0%, #0d9488 100%); }
.hero-gradient-other { background: linear-gradient(135deg, #0d9488 0%, #f97316 100%); }

.hero-content { position: relative; z-index: 2; }

.hero-greeting {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.92;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-stat {
    font-weight: 700;
    font-size: 1.1em;
}

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

.btn-hero-primary {
    background: white;
    color: var(--dark);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-hero-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.2s;
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
}

/* Decorative confetti */
.hero-decoration {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 200px;
    pointer-events: none;
}

.confetti {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.5;
    animation: confettiFloat 6s ease-in-out infinite;
}

.confetti.c1 { top: 15%; right: 15%; animation-delay: 0s; }
.confetti.c2 { top: 50%; right: 30%; animation-delay: 2s; font-size: 1.25rem; }
.confetti.c3 { top: 75%; right: 10%; animation-delay: 4s; font-size: 1rem; }

@keyframes confettiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
    50% { transform: translateY(-12px) rotate(15deg); opacity: 0.8; }
}

/* ===== Recent Memories Carousel ===== */
.recent-memories {
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.memories-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.memories-strip::-webkit-scrollbar { height: 4px; }
.memories-strip::-webkit-scrollbar-track { background: transparent; }
.memories-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.memory-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
    position: relative;
    box-shadow: 0 2px 8px var(--warm-shadow);
    transition: transform 0.2s;
    text-decoration: none;
}

.memory-thumb:hover { transform: scale(1.08); }

.memory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memory-album-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.6rem;
    padding: 12px 4px 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-thumb:hover .memory-album-name { opacity: 1; }

/* ===== Polaroid Album Cards ===== */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    padding: 0.5rem;
    margin-bottom: 2rem;
}

.album-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Rotation pattern */
.album-card:nth-child(4n+1) { transform: rotate(-2deg); }
.album-card:nth-child(4n+2) { transform: rotate(1deg); }
.album-card:nth-child(4n+3) { transform: rotate(-1deg); }
.album-card:nth-child(4n+4) { transform: rotate(1.5deg); }

.album-card:hover {
    transform: rotate(0deg) translateY(-8px) !important;
    z-index: 2;
}

.polaroid-frame {
    background: white;
    padding: 6px 6px 0 6px;
    border-radius: 4px;
    box-shadow:
        0 2px 8px var(--warm-shadow),
        0 4px 20px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}

.album-card:hover .polaroid-frame {
    box-shadow:
        0 8px 30px rgba(0,0,0,0.12),
        0 4px 15px var(--warm-shadow);
}

.polaroid-frame .album-cover {
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.album-type-emoji {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    z-index: 1;
}

.badge-admin {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--teal);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.polaroid-caption {
    padding: 0.75rem 0.5rem;
}

.polaroid-caption .album-name {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--dark);
}

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

.album-date {
    font-size: 0.75rem;
    color: #888;
}

.album-counters {
    font-size: 0.75rem;
    color: #888;
}

.album-actions {
    display: flex;
    gap: 0.4rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--teal);
    background: var(--teal-light);
}

/* ===== Enhanced Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem 4rem;
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 12px var(--warm-shadow);
}

.empty-polaroids {
    position: relative;
    height: 160px;
    margin: 0 auto 2rem;
    width: 240px;
}

.empty-polaroid {
    position: absolute;
    width: 100px;
    background: white;
    padding: 6px 6px 24px 6px;
    border-radius: 3px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ep-photo {
    width: 88px;
    height: 66px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--teal-light) 0%, #e0f2fe 100%);
}

.empty-polaroid.ep-1 {
    left: 20px;
    top: 20px;
    transform: rotate(-12deg);
    animation: emptyFloat1 4s ease-in-out infinite;
}

.empty-polaroid.ep-2 {
    left: 70px;
    top: 10px;
    transform: rotate(5deg);
    z-index: 2;
    animation: emptyFloat2 4s ease-in-out infinite 1.3s;
}

.empty-polaroid.ep-3 {
    left: 120px;
    top: 25px;
    transform: rotate(-3deg);
    animation: emptyFloat3 4s ease-in-out infinite 2.6s;
}

.empty-polaroid.ep-2 .ep-photo {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.empty-polaroid.ep-3 .ep-photo {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
}

@keyframes emptyFloat1 {
    0%, 100% { transform: translateY(0) rotate(-12deg); }
    50% { transform: translateY(-8px) rotate(-12deg); }
}

@keyframes emptyFloat2 {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes emptyFloat3 {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(-3deg); }
}

.empty-state h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.empty-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-dark); }

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--teal); }

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1rem;
}

.qr-container img { width: 200px; height: 200px; }

.qr-code {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--teal);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

/* Album Picker Modal */
.modal-picker { max-width: 360px; }

.picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.picker-item:hover {
    border-color: var(--teal);
    background: var(--teal-light);
}

.picker-name { font-weight: 500; color: var(--dark); }
.picker-stats { font-size: 0.8rem; color: #888; }

/* Lang Selector */
.lang-selector {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
}

.lang-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}

.lang-btn:hover { color: var(--teal); }

.lang-btn.active {
    background: white;
    color: var(--teal);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-greeting { font-size: 1.75rem; }
    .albums-grid { gap: 1.5rem; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.active { display: block; }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .user-name { display: none; }

    .hero-banner { padding: 1.75rem; }
    .hero-greeting { font-size: 1.5rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-decoration { display: none; }

    .memory-thumb { width: 72px; height: 72px; }

    /* Remove rotations on mobile */
    .album-card:nth-child(n) { transform: none; }
    .album-card:hover { transform: translateY(-4px) !important; }

    .albums-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .hero-banner { padding: 1.25rem; }
    .hero-greeting { font-size: 1.3rem; }
    .hero-actions { flex-direction: column; }
    .btn-hero-primary, .btn-hero-secondary { text-align: center; }

    .albums-grid { grid-template-columns: 1fr; }

    .polaroid-caption .album-name { font-size: 0.9rem; }
    .album-meta { flex-direction: column; align-items: flex-start; gap: 0.125rem; }

    .empty-polaroids { transform: scale(0.85); }
}
