/* Kollektica - Premium Design System (Mobile + Desktop) */

@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes countdown-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.animate-slide-in { animation: slide-in 0.3s ease-out; }
.animate-slide-up { animation: slide-up 0.4s ease-out; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-fade-in-up { animation: fade-in-up 0.5s ease-out both; }
.animate-float { animation: float 3s ease-in-out infinite; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }
.safe-area-top { padding-top: env(safe-area-inset-top, 0); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Gradient overlays ─── */
.gradient-overlay { background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, transparent 100%); }
.gradient-dark { background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); }

/* ─── Countdown chip ─── */
.countdown-chip {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    color: white;
    font-weight: 600;
}
.countdown-chip.urgent { background: rgba(220,38,38,0.85); }

/* ─── Save button ─── */
.save-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}
.save-btn:hover, .save-btn.saved { background: #E53935; color: white; }
.save-btn.saved svg { fill: white; }

/* ─── Object Card ─── */
.obj-card {
    border-radius: 16px;
    overflow: hidden;
    background: white;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.obj-card:active { transform: scale(0.98); }
@media (min-width: 768px) {
    .obj-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }
    .obj-card:active { transform: scale(1); }
}
.obj-card .obj-img {
    aspect-ratio: 1/1;
    object-fit: cover;
    width: 100%;
    border-radius: 16px 16px 0 0;
}

/* ─── Auction Card ─── */
.auction-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #F3F4F6;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
@media (min-width: 768px) {
    .auction-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }
}
.auction-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.auction-collage img { width: 100%; height: 100%; object-fit: cover; }
.auction-collage .collage-main { grid-row: 1 / 3; }
.auction-collage .collage-count {
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7);
    color: white; font-weight: 700; font-size: 18px;
}

/* ─── Category chip ─── */
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #E5E7EB;
    background: white;
    color: #374151;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-chip.active, .cat-chip:hover {
    background: #E53935;
    color: white;
    border-color: #E53935;
}

/* ─── Badge styles ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-red { background: #FEE2E2; color: #DC2626; }
.badge-green { background: #DCFCE7; color: #16A34A; }
.badge-yellow { background: #FEF3C7; color: #D97706; }
.badge-blue { background: #DBEAFE; color: #2563EB; }
.badge-purple { background: #F3E8FF; color: #7C3AED; }
.badge-gray { background: #F3F4F6; color: #6B7280; }
.badge-pink { background: #FCE7F3; color: #DB2777; }
.badge-dark { background: rgba(0,0,0,0.7); color: white; backdrop-filter: blur(4px); }
.badge-live { background: #DC2626; color: white; }
.badge-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: white; animation: pulse-ring 1.5s infinite; }

/* ─── Popularity badges ─── */
.pop-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 8px;
    font-size: 11px; font-weight: 600;
}
.pop-trending { background: #FEF3C7; color: #D97706; }
.pop-hot { background: #FEE2E2; color: #DC2626; }
.pop-followed { background: #DBEAFE; color: #2563EB; }
.pop-bid { background: #DCFCE7; color: #16A34A; }

/* ─── Message bubbles ─── */
.msg-sent { background: #E53935; color: white; border-radius: 18px 18px 4px 18px; }
.msg-received { background: #f3f4f6; color: #111827; border-radius: 18px 18px 18px 4px; }

/* ─── Tab system ─── */
.tab-nav { display: flex; border-bottom: 1px solid #E5E7EB; }
.tab-item {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #9CA3AF;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-item.active { color: #E53935; border-bottom-color: #E53935; }

/* ─── Upload zone ─── */
.upload-zone { border: 2px dashed #d1d5db; transition: all 0.2s; border-radius: 16px; }
.upload-zone:hover, .upload-zone.dragover { border-color: #E53935; background: #FEF2F2; }

/* ─── Loading spinner ─── */
.spinner { border: 3px solid #f3f4f6; border-top: 3px solid #E53935; border-radius: 50%; width: 24px; height: 24px; animation: spin 0.8s linear infinite; }

/* ─── Modal backdrop ─── */
.modal-backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }

/* ─── Welcome page ─── */
.welcome-bg {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(20px);
}
.welcome-pattern {
    background-image:
        url('https://picsum.photos/seed/w1/300/400'),
        url('https://picsum.photos/seed/w2/300/400'),
        url('https://picsum.photos/seed/w3/300/400'),
        url('https://picsum.photos/seed/w4/300/400');
    background-size: 50% 50%;
    background-position: top left, top right, bottom left, bottom right;
    background-repeat: no-repeat;
    opacity: 0.15;
}

/* ─── Smooth transitions ─── */
input, select, textarea, button, a { transition: all 0.2s ease; }

/* ─── Focus ring ─── */
.focus-ring:focus { outline: none; box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15); border-color: #E53935; }

/* ─── Artist grid ─── */
.artist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 768px) { .artist-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .artist-grid { grid-template-columns: repeat(4, 1fr); } }
.artist-grid .art-item {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
}
.artist-grid .art-item img { width: 100%; height: 100%; object-fit: cover; }
.artist-grid .art-title {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white; font-size: 12px; font-weight: 600;
}

/* ─── Profile stat ─── */
.profile-stat { text-align: center; }
.profile-stat .stat-num { font-size: 18px; font-weight: 700; color: #111827; }
.profile-stat .stat-label { font-size: 12px; color: #9CA3AF; }

/* ─── Bottom sheet ─── */
.bottom-sheet {
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

/* ─── Desktop nav dropdown ─── */
.nav-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}
.nav-dropdown.show, .nav-parent:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ─── Desktop sidebar ─── */
.desktop-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* ─── Desktop card hover effects ─── */
@media (min-width: 768px) {
    .card-hover { transition: all 0.3s ease; }
    .card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
}

/* ─── Desktop split layout helper ─── */
.split-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 1024px) {
    .split-layout {
        flex-direction: row;
        gap: 40px;
    }
    .split-layout .split-main { flex: 1; min-width: 0; }
    .split-layout .split-side { width: 380px; flex-shrink: 0; }
}

/* ─── Desktop image gallery ─── */
.gallery-desktop {
    display: none;
}
@media (min-width: 1024px) {
    .gallery-mobile { display: none; }
    .gallery-desktop {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 12px;
        align-items: start;
    }
    .gallery-desktop .gallery-thumbs {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-y: auto;
        max-height: min(72vh, 640px);
    }
    .gallery-desktop .gallery-thumbs img {
        width: 72px; height: 72px;
        object-fit: cover;
        border-radius: 10px;
        border: 2px solid transparent;
        cursor: pointer;
        transition: all 0.2s;
    }
    .gallery-desktop .gallery-thumbs img:hover,
    .gallery-desktop .gallery-thumbs img.active {
        border-color: #E53935;
    }
    /* Ana görsel: grid stretch kaymasını önle, görseli dikey/yatay ortala (Tailwind CDN üzerine yazmak için !important) */
    .gallery-desktop .gallery-main {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100%;
        aspect-ratio: 4 / 5;
        max-height: min(72vh, 640px);
        min-height: 280px;
        overflow: hidden;
    }
    .gallery-desktop .gallery-main img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 12px;
    }
}

/* ─── Desktop rich footer ─── */
.desktop-footer {
    background: #111827;
    color: #9CA3AF;
}
.desktop-footer a { color: #D1D5DB; }
.desktop-footer a:hover { color: #E53935; }
.desktop-footer h4 { color: white; font-size: 14px; font-weight: 600; margin-bottom: 16px; }

/* ─── Desktop hero section ─── */
@media (min-width: 1024px) {
    .hero-section {
        border-radius: 24px;
        overflow: hidden;
        position: relative;
    }
}

/* ─── Desktop breadcrumb ─── */
.breadcrumb { display: none; }
@media (min-width: 768px) {
    .breadcrumb {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #6B7280;
        margin-bottom: 16px;
    }
    .breadcrumb a { color: #6B7280; }
    .breadcrumb a:hover { color: #E53935; }
    .breadcrumb .sep { color: #D1D5DB; }
}

/* ─── Line clamp ─── */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
