/* Modern Clean Theme - Soft UI */

/* Base Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, transform, box-shadow, opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Custom Scrollbar - Clean Slate */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    /* Slate 300 */
    border-radius: 99px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    /* Slate 400 */
}

/* Dark Mode Scrollbar */
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dark .custom-scrollbar {
    scrollbar-color: #475569 transparent;
}

/* Tier Box Styling - Modern Dashboard Look */
.box {
    display: flex;
    min-height: 100px;
    background: #f8fafc;
    /* Slate 50 */
    border: 1px solid #e2e8f0;
    /* Slate 200 */
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.dark .box {
    background: #0f172a;
    /* Slate 900 */
    border-color: #334155;
}

.box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dark .box:hover {
    border-color: #475569;
}

/* Tier Label - Resized (30% smaller) */
.box .name {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    /* Reduced from 80px */
    flex-shrink: 0;
    color: #1e293b;
    /* Slate 800 */
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    /* Reduced from 1.25rem */
    text-align: center;
    padding: 0 4px;
    /* Reduced padding */
    word-break: break-word;
    line-height: 1.2;
}

/* Tier Items Container */
.box .items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    width: 100%;
    align-items: center;
    background: white;
}

.dark .box .items {
    background: #1e293b;
    /* Slate 800 */
}

/* Draggable Items (Album Art) */
.album {
    width: 70px;
    height: 100px;
    cursor: grab;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    background: #cbd5e1;
    /* Placeholder color */
    touch-action: none;
    /* Prevent native scrolling when touching items */
}

.album:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.album img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album:active {
    cursor: grabbing;
}

/* Drag State */
.dragging {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Search Result Cards */
.search-result-card {
    position: relative;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.dark .search-result-card {
    background: #1e293b;
    border-color: #334155;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
    /* Primary Indigo */
}

.search-result-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

/* List View Overrides */
.list-view {
    grid-template-columns: 1fr !important;
}

.list-view .search-result-card {
    display: flex;
    flex-direction: row;
    height: 60px;
    align-items: center;
}

/* Target the image WRAPPER div (first child) */
.list-view .search-result-card>div:first-child {
    width: 45px !important;
    /* Fixed width */
    height: 100% !important;
    aspect-ratio: auto !important;
    /* Override Tailwind aspect-ratio */
    flex-shrink: 0;
}

.list-view .search-result-card img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.list-view .card-content {
    padding: 0 10px;
    flex: 1;
}

/* Mobile Dragging Clone */
.mobile-dragging {
    opacity: 0.4 !important;
    /* FAST MODE: High transparency */
    box-shadow: none !important;
    /* FAST MODE: No shadow calculation */
    z-index: 9999 !important;
    pointer-events: none;
    border-radius: 8px;
    will-change: transform, left, top;
    backface-visibility: hidden;
    transform: translateZ(0);
    /* Force GPU acceleration */
    transition: none !important;
    /* CRITICAL: Prevent lag/interpolation during drag */
}

/* Settings Modal Rows */
.tier-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.dark .tier-setting-row {
    background: #0f172a;
    border-color: #334155;
}

.tier-name-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 4px;
    font-size: 0.9rem;
    color: #334155;
}

.dark .tier-name-input {
    color: #e2e8f0;
    border-bottom-color: #475569;
}

.tier-name-input:focus {
    outline: none;
    border-bottom-color: #6366f1;
}

/* Unranked Pool - Transparent Blur Effect */
.unranked-pool-container {
    background-color: rgba(255, 255, 255, 0.4) !important;
    /* Reduced opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark .unranked-pool-container {
    background-color: rgba(30, 41, 59, 0.4) !important;
    /* Reduced opacity */
    border-color: rgba(51, 65, 85, 0.3);
}

#pool-items {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    align-items: center;
    max-height: 140px !important;
    /* Adjusted for scrollbar */
    padding-bottom: 10px;
    /* Space for scrollbar */
}

#pool-items .album {
    width: 56px;
    height: 80px;
    flex-shrink: 0;
}

/* Utility Fallback */
.bg-primary {
    background-color: #6366f1 !important;
}

.text-primary {
    color: #6366f1 !important;
}

.border-primary {
    border-color: #6366f1 !important;
}

/* Mobile View Optimization */
@media (max-width: 768px) {

    /* Scale tierlist items to ~70% of desktop size (70px -> 49px) */
    /* Unranked pool items remain fixed size */
    .album {
        width: 49px;
        height: 70px;
    }

    /* Tier Row Items: Force 10 columns */
    .box .items {
        display: grid !important;
        grid-template-columns: repeat(10, 1fr) !important;
        gap: 2px !important;
        padding: 2px !important;
    }

    /* Fluid width for Tier Items to fit in grid */
    .box .items .album {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 0.7 !important;
        border-radius: 3px;
    }

    /* Unranked Pool - Horizontal Scroll */
    #pool-items {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        /* unintended vertical scroll prevention */
        white-space: nowrap;
        justify-content: flex-start;
        align-items: center;
        max-height: 110px !important;
        /* Adjust for scrollbar */
        padding-bottom: 10px;
        /* Space for scrollbar */
    }

    /* Override pool item specific size to match mobile scale */
    #pool-items .album {
        width: 49px;
        height: 70px;
        flex-shrink: 0;
    }

    /* Reduce Box Min-Height (Row Height) to 50% */
    .box {
        min-height: 50px;
    }

    /* Scale Tier Labels (Half of 56px width = 28px) */
    .box .name {
        width: 28px;
        /* Half of desktop width */
        font-size: 0.65rem;
        /* ~70% of 0.9rem */
        padding: 0 1px;
    }

    /* Decrease size of "rest of website" (Header & Controls) by 30% (was 40%) */
    header,
    .container>.flex-col>div:first-child {
        zoom: 0.7;
    }
}/* Toast Notification */
.toast {
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    border-left: 3px solid #4ade80;
    /* Green 400 */
}

.toast.error {
    border-left: 3px solid #f43f5e;
    /* Rose 500 */
}

.toast.warning {
    border-left: 3px solid #facc15;
    /* Yellow 400 */
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
