* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff3366;
    --primary-dark: #cc0044;
    --accent-gold: #ffd700;
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #888888;
    --border-color: rgba(255, 51, 102, 0.2);
    --shadow-glow: 0 0 20px rgba(255, 51, 102, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.8);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.9);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 51, 102, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.dark-mode {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
}

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.3;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 25s infinite ease-in-out;
}

.bg-circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.3) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    bottom: -50px;
    right: -50px;
    animation-delay: 8s;
}

.bg-circle-3 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.15) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    33% {
        transform: translate(50px, -50px);
        opacity: 0.5;
    }
    66% {
        transform: translate(-30px, 30px);
        opacity: 0.2;
    }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
}

.header {
    padding: 25px 0;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.brand-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.brand-text h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: -2px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 51, 102, 0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-item:hover::before {
    opacity: 0.1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 215, 0, 0.1));
    color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.nav-item.active::before {
    opacity: 0;
}

.nav-icon {
    font-size: 18px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.liked-btn, .theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.liked-btn:hover, .theme-toggle:hover {
    background: rgba(255, 51, 102, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.liked-btn svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 4px var(--primary-color));
}

.liked-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    gap: 20px;
}

.toolbar-left, .toolbar-right {
    flex: 1;
}

.toolbar-center {
    display: flex;
    justify-content: center;
}

.photo-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    font-size: 18px;
    color: var(--primary-color);
}

.shuffle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.shuffle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.shuffle-btn:hover::before {
    width: 300px;
    height: 300px;
}

.shuffle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
}

.shuffle-btn:active {
    transform: translateY(-1px);
}

.shuffle-hint {
    font-size: 11px;
    opacity: 0.9;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.view-options {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-left: auto;
    border: 1px solid rgba(255, 51, 102, 0.1);
}

.view-btn {
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 51, 102, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 215, 0, 0.1));
    color: var(--primary-color);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 30px 0;
    animation: fadeIn 0.6s ease;
}

.photo-grid.masonry {
    columns: 4;
    column-gap: 24px;
}

.photo-grid.masonry .photo-card {
    break-inside: avoid;
    margin-bottom: 24px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-card {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 51, 102, 0.1);
    animation: slideUp 0.6s ease backwards;
}

.photo-card:nth-child(n) {
    animation-delay: calc(0.03s * var(--index));
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.photo-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(255, 51, 102, 0.3), 
                0 0 0 1px rgba(255, 51, 102, 0.3);
    border-color: var(--primary-color);
}

.photo-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95) contrast(1.05);
}

.photo-grid.masonry .photo-card img {
    height: auto;
}

.photo-card:hover img {
    transform: scale(1.1);
    filter: brightness(1) contrast(1.1);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    color: white;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-card:hover .photo-overlay {
    transform: translateY(0);
}

.photo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.like-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 51, 102, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 51, 102, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.like-btn:hover {
    background: rgba(255, 51, 102, 0.4);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
}

.like-btn.liked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
}

.like-btn.liked svg {
    fill: white;
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.photo-index {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-tertiary);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.3));
}

.empty-state p {
    font-size: 18px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.5);
}

.spinner-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    animation-delay: 0.2s;
    border-top-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    animation-delay: 0.4s;
    border-top-color: #8a2be2;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(30px);
}

.modal.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 51, 102, 0.2);
}

.modal-info {
    color: white;
    font-size: 15px;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: rgba(255, 51, 102, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 30px;
}

.modal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(255, 51, 102, 0.3);
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.image-loading.active {
    display: block;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 51, 102, 0.15);
    border: 2px solid rgba(255, 51, 102, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: rgba(255, 51, 102, 0.3);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.6);
}

.nav-prev {
    left: 40px;
}

.nav-next {
    right: 40px;
}

.modal-footer {
    padding: 25px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 51, 102, 0.2);
}

.modal-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(255, 51, 102, 0.15);
    border: 2px solid rgba(255, 51, 102, 0.3);
    border-radius: var(--radius-xl);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-like-btn:hover {
    background: rgba(255, 51, 102, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.5);
}

.modal-like-btn.liked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.8);
}

.modal-like-btn.liked svg {
    fill: white;
}

.likes-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

.likes-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.likes-modal-content {
    width: 90%;
    max-width: 1400px;
    height: 85vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(255, 51, 102, 0.3);
}

.likes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 51, 102, 0.05);
}

.likes-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.likes-close-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 51, 102, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.likes-close-btn:hover {
    background: rgba(255, 51, 102, 0.2);
    transform: rotate(90deg) scale(1.1);
}

.likes-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.likes-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.likes-empty svg {
    opacity: 0.3;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.3));
}

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.95), rgba(204, 0, 68, 0.95));
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(255, 51, 102, 0.5);
    border: 1px solid rgba(255, 51, 102, 0.5);
    font-size: 15px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 4000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
    .photo-grid.masonry {
        columns: 3;
    }
    
    .likes-modal-body {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .nav-menu {
        justify-content: center;
        overflow-x: auto;
    }
    
    .nav-item span:not(.nav-icon) {
        display: none;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 20px;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .photo-grid.masonry {
        columns: 2;
    }
    
    .photo-card img {
        height: 350px;
    }
    
    .nav-arrow {
        display: none;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .likes-modal-body {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .photo-grid.masonry {
        columns: 1;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 20px;
    }
}