/* css/list.css */

/* BRAND TOKENS: Midnight Mint */
:root {
    --obsidian: #080A0C;
    --mint: #00F5D4;
    --mint-dim: #00c4aa;
    --slate: #1A1F24;
    --oxygen: #FFFFFF;
}

.klokin-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* ── "The Designer's Touch" ── 
   Alle knapper i softwaren skal have en 0.5px border i "KlokIn Mint" 
   med meget lav gennemsigtighed for en følelse af glas facade.
*/
.kl-glass-btn {
    border-width: 0.5px !important;
    border-style: solid !important;
    border-color: rgba(0, 245, 212, 0.25) !important;
    transition: all 0.2s ease-in-out;
}
.kl-glass-btn:hover:not(:disabled) {
    background-color: rgba(0, 245, 212, 0.05) !important;
    border-color: rgba(0, 245, 212, 0.5) !important;
    color: var(--mint-dim);
}
.dark .kl-glass-btn:hover:not(:disabled) {
    color: var(--mint);
    /* "The Pulse" effekt - en svag pulserende glød i mint */
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.1); 
}

/* Smooth fade in when changing pages/sorting */
.klokin-list-body {
    transition: opacity 0.2s ease-in-out;
}
.klokin-list-body.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Row animation */
.klokin-row {
    animation: slideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(6px);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger animation for rows (up to 10) */
.klokin-row:nth-child(1) { animation-delay: 0ms; }
.klokin-row:nth-child(2) { animation-delay: 30ms; }
.klokin-row:nth-child(3) { animation-delay: 60ms; }
.klokin-row:nth-child(4) { animation-delay: 90ms; }
.klokin-row:nth-child(5) { animation-delay: 120ms; }
.klokin-row:nth-child(6) { animation-delay: 150ms; }
.klokin-row:nth-child(7) { animation-delay: 180ms; }
.klokin-row:nth-child(8) { animation-delay: 210ms; }
.klokin-row:nth-child(9) { animation-delay: 240ms; }
.klokin-row:nth-child(10) { animation-delay: 270ms; }

/* 
   MOBILE RESPONSIVE STYLES 
   Transforms Table into Cards on small screens (<768px)
*/
@media (max-width: 768px) {
    /* Force table elements to block display */
    .kl-table, .kl-table thead, .kl-table tbody, .kl-table th, .kl-table td, .kl-table tr {
        display: block;
    }

    /* Hide table header visually */
    .kl-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* Style Rows as Cards */
    .kl-table tr {
        margin-bottom: 1rem;
        background-color: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        padding: 0.5rem 0;
    }

    /* DARK MODE KORT: Aarhus Slate */
    :is(.dark .kl-table tr) {
        background-color: var(--slate); 
        border-color: rgba(255, 255, 255, 0.06); 
    }

    /* Style Cells */
    .kl-table td {
        border: none;
        position: relative;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        text-align: right;
        border-bottom: 1px solid #f3f4f6; 
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 3.5rem;
    }

    /* Dark mode cell border */
    :is(.dark .kl-table td) {
        border-color: rgba(255, 255, 255, 0.04);
    }

    /* Remove border from last cell */
    .kl-table td:last-child {
        border-bottom: 0;
    }

    /* Inject Header Labels via CSS using data-label attribute */
    .kl-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.65rem;
        color: #9ca3af; 
        text-align: left;
        margin-right: 1rem;
    }
    
    /* Hide label if data-label is empty (e.g. actions) */
    .kl-table td[data-label=""]::before {
        content: none;
    }
    
    /* Ensure action buttons in cards align right or take full width if needed */
    .kl-table td:last-child {
        justify-content: flex-end;
        padding-top: 1rem;
    }
}