/**
 * OSOSEDKI - Main Stylesheet
 * CSS Grid layout, optimized for performance
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary: #6610f2;
    --primary-dark: #520dc2;
    --secondary: #6c757d;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #212529;
    --light: #f8f9fa;
    
    --gap: 0.5rem;
    --radius: 0.5rem;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
    
    --transition: all 0.2s ease;
}

/* ========================================
   Base Styles
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #6610f2;
}

.main-content {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
}

/* ========================================
   Gallery Grid (CSS Grid - replaces Masonry)
   ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
}

@media (min-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0.75rem;
    }
}

@media (min-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.gallery-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* ========================================
   Gallery Item (Album Card)
   ======================================== */
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--dark);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.gallery-link {
    display: block;
    color: inherit;
}

.gallery-figure {
    position: relative;
    margin: 0;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Lazy load placeholder */
.gallery-img.lazy {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.gallery-img.lazy.loaded {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Caption overlay */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 0.75rem 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    color: white;
}

.gallery-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta info */
.gallery-meta {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.7rem;
}

.gallery-date {
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.gallery-category {
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
}

/* Stats */
.gallery-stats {
    position: absolute;
    bottom: 2.5rem;
    left: 0.75rem;
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
}

.gallery-stats i {
    margin-right: 0.25rem;
}

/* NEW badge */
.badge-new {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   Videos Grid
   ======================================== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
}

@media (min-width: 992px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.videos-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ========================================
   Video Item
   ======================================== */
.video-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--dark);
    transition: var(--transition);
}

.video-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.video-link {
    display: block;
    color: inherit;
}

.video-figure {
    position: relative;
    margin: 0;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Play icon */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: var(--transition);
    pointer-events: none;
}

.video-item:hover .video-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    color: white;
}

.video-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 0.75rem 0.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    color: white;
}

.video-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.7rem;
}

.video-meta span {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.video-date {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ========================================
   Photos Grid (Album View)
   ======================================== */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.25rem;
    padding: 0.25rem;
}

@media (min-width: 576px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.5rem;
    }
}

@media (min-width: 992px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.photo-item {
    position: relative;
    margin: 0;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 0.25rem;
    cursor: pointer;
}

.photo-item a {
    display: block;
    width: 100%;
    height: 100%;
}

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

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

.photo-number {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* ========================================
   Video Player
   ======================================== */
.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========================================
   Pagination
   ======================================== */
.pagination-nav {
    padding: 1rem;
}

.pagination {
    margin: 0;
    flex-wrap: wrap;
}

.page-link {
    border: none;
    margin: 0.125rem;
    border-radius: 0.25rem !important;
    min-width: 2.5rem;
    text-align: center;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ========================================
   Loading Indicator
   ======================================== */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* ========================================
   Album Info
   ======================================== */
.album-info {
    text-align: center;
}

/* ========================================
   Navbar Customization
   ======================================== */
.navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}

.text-purple {
    color: var(--primary) !important;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    margin-top: auto;
}

.footer .nav-link:hover {
    color: white !important;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    background: transparent;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.5);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* ========================================
   Clubs Grid
   ======================================== */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.club-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

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

.club-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--light);
}

.club-info h3 {
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
}

.club-info p {
    font-size: 0.75rem;
    color: var(--secondary);
    margin: 0;
}

/* ========================================
   Utilities
   ======================================== */
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }

/* Smooth image loading */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded,
img:not([data-src]) {
    opacity: 1;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar, .footer, .pagination-nav, .loading-indicator {
        display: none !important;
    }
}

/* Icon color utilities */
.text-pink { color: #d63384 !important; }
.text-orange { color: #fd7e14 !important; }
.text-purple { color: #6610f2 !important; }

/* SVG icons vertical alignment */
svg {
    vertical-align: -0.125em;
}

.banner-item {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 0.25rem;
    background: #1a1a1a;
}

.banner-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Banner in gallery grid */
.banner-item .gallery-figure {
    aspect-ratio: 3/4;
    background: #1a1a1a;
    border-radius: var(--radius);
    overflow: hidden;
}