@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

/* =========================================
   PERUSASETUKSET JA TAUSTA
   ========================================= */
body {
    font-family: 'Inter', sans-serif;
    /* Super moderni animoitu liukuväritausta */
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #121212);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   LASIEFEKTIT (GLASSMORPHISM)
   ========================================= */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    padding: 2rem;
}

/* Yläpalkki */
.glass-nav {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: -webkit-linear-gradient(45deg, #00d2ff, #3a7bd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

/* =========================================
   LOMAKKEET, INPUTIT JA SELECTIT
   ========================================= */
.form-label {
    font-size: 0.9rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    display: block;
}

.glass-input,
.glass-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
}

/* Pudotusvalikon optiot tarvitsevat taustavärin */
.glass-select option {
    background: #203a43; 
    color: #fff;
}

.glass-input:focus,
.glass-select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

/* =========================================
   PAINIKKEET
   ========================================= */
.glass-btn {
    width: 100%;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.4);
}

.glass-btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.glass-btn-danger:hover {
    box-shadow: 0 8px 20px rgba(255, 65, 108, 0.4);
}

.glass-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* =========================================
   TAULUKOT
   ========================================= */
.glass-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.glass-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.glass-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 300;
    vertical-align: middle;
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   ASETTELU JA LAYOUT (GRIDIT)
   ========================================= */
/* Päänäkymän yhden sarakkeen leiska */
.layout-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Admin-sivun korttigridi */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   SUODATINPALKKI (FILTTERIT)
   ========================================= */
/* Työpöytänäkymä */
.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto; /* Ei venytetä täyteen leveyteen */
}

.filter-bar .glass-input,
.filter-bar .glass-select {
    width: 180px; /* Kiinteä leveys työpöydällä */
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Mobiilinäkymän korjaukset (alle 768px näytöt) */
@media (max-width: 768px) {
    .filter-group {
        flex: 1 1 100%; /* Mobiilissa pakotetaan 100% leveyteen */
    }
    
    .filter-bar .glass-input,
    .filter-bar .glass-select {
        width: 100%;
    }
    
    .filter-actions {
        flex: 1 1 100%;
        margin-top: 10px;
    }
    
    .filter-actions .glass-btn {
        flex: 1; /* Napit jakavat tilan tasan mobiilissa */
    }
}
/* =========================================
   MODAALI (PONNAHDUSIKKUNA)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.modal-close {
    background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer;
}

/* Taulukon sisäiset asettelut */
.table-checkbox-label {
    display: flex; align-items: center; gap: 5px; font-size: 0.8rem; cursor: pointer;
    margin-bottom: 5px;
}
/* Timer / Nauhoitusnapin animaatio */
@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(255, 65, 108, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 65, 108, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 65, 108, 0); }
}
.btn-timer-active {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    animation: pulseRed 2s infinite;
    color: white;
}
.btn-timer-start {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #000;
}