/**
 * DarkCoal Discovery Styles
 *
 * Discovery-specific styles that can't be handled by Tailwind utility classes.
 The app uses Tailwind, so this is minimal — mostly animations, grid layouts,
 and custom scrollbar styling.
 */

/* ===================================================== */
/* DISCOVERY VIEW */
/* ===================================================== */

#discover-content {
    display: flex;
    flex-direction: column;
}

#discover-content.hidden {
    display: none !important;
}

#socials-content.hidden {
    display: none !important;
}

#discovery-advanced-filters.hidden {
    display: none !important;
}

/* ===================================================== */
/* SCROLL WRAPPER — flex child that handles scrolling */
/* ===================================================== */

#discovery-scroll {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ===================================================== */
/* CHARACTER GRID — Masonry / chaotic layout */
/* ===================================================== */

#discovery-grid {
    column-count: 2;
    column-gap: 0.75rem;
    padding: 0.75rem;
}

#discovery-grid > .discovery-card {
    break-inside: avoid;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    #discovery-grid {
        column-count: 3;
    }
}

@media (min-width: 768px) {
    #discovery-grid {
        column-count: 4;
    }
}

@media (min-width: 1024px) {
    #discovery-grid {
        column-count: 5;
        column-gap: 0.75rem;
    }
}

/* ===================================================== */
/* CHARACTER CARD */
/* ===================================================== */

.discovery-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.discovery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.discovery-card:active {
    transform: translateY(0);
}

/* Card image container */
.discovery-card .card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

/* Card info section sizes to content dynamically */
.discovery-card .card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
}

.discovery-card img {
    transition: transform 0.2s ease;
}

.discovery-card:hover img {
    transform: scale(1.05);
}

/* ===================================================== */
/* NSFW BLUR */
/* ===================================================== */

/* NSFW cards are blurred by default */
.discovery-card[data-rating="nsfw"] img {
    filter: blur(20px);
    transition: filter 0.2s ease;
}

.discovery-card[data-rating="nsfw"]:hover img,
.discovery-card[data-rating="nsfw"].nsfw-unblurred img {
    filter: none;
}

/* ===================================================== */
/* MODALS */
/* ===================================================== */

.discovery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.discovery-modal.hidden {
    display: none !important;
}

.discovery-modal-content {
    background: #1f2937;
    border-radius: 1rem;
    border: 1px solid #374151;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
    .discovery-modal-content {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
}

/* ===================================================== */
/* FILTER BAR */
/* ===================================================== */

.discovery-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.5);
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.discovery-filter-bar select,
.discovery-filter-bar input {
    background: #374151;
    border: 1px solid #4B5563;
    color: #D1D5DB;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.discovery-filter-bar select:focus,
.discovery-filter-bar input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.3);
}

.discovery-filter-bar input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.discovery-filter-bar select {
    min-width: 100px;
}

/* ===================================================== */
/* LOADING STATES */
/* ===================================================== */

.discovery-loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #374151;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================== */
/* LOADING OVERLAY (for upload) */
/* ===================================================== */

.discovery-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* ===================================================== */
/* SCROLLBAR */
/* ===================================================== */

#discovery-comments-list::-webkit-scrollbar,
.discovery-modal-content::-webkit-scrollbar {
    width: 6px;
}

#discovery-comments-list::-webkit-scrollbar-track,
.discovery-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

#discovery-comments-list::-webkit-scrollbar-thumb,
.discovery-modal-content::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 3px;
}

#discovery-comments-list::-webkit-scrollbar-thumb:hover,
.discovery-modal-content::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* ===================================================== */
/* BADGES */
/* ===================================================== */

.discovery-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.discovery-badge-sfw {
    background-color: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.discovery-badge-nsfw {
    background-color: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

/* ===================================================== */
/* ANIMATIONS */
/* ===================================================== */

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

.discovery-animate-in {
    animation: fadeIn 0.2s ease-out;
}

.discovery-card {
    animation: slideUp 0.3s ease-out both;
}

.discovery-card:nth-child(1) { animation-delay: 0.0s; }
.discovery-card:nth-child(2) { animation-delay: 0.05s; }
.discovery-card:nth-child(3) { animation-delay: 0.1s; }
.discovery-card:nth-child(4) { animation-delay: 0.15s; }
.discovery-card:nth-child(5) { animation-delay: 0.2s; }
.discovery-card:nth-child(6) { animation-delay: 0.25s; }
.discovery-card:nth-child(7) { animation-delay: 0.3s; }
.discovery-card:nth-child(8) { animation-delay: 0.35s; }
