/**
 * Cinema Guides Frontend Styles
 */

.ktn-guides-container {
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    padding: 0 20px;
}

.ktn-guides-header {
    text-align: center;
    margin-bottom: 40px;
}

.ktn-guides-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #111;
}

.ktn-guides-header .ktn-subtitle {
    font-size: 16px;
    color: #666;
}

/* Tabs */
.ktn-guides-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    background: #f4f4f5;
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.ktn-tab-btn {
    border: none;
    background: transparent;
    padding: 10px 35px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
}

.ktn-tab-btn:hover {
    color: #1e293b;
}

.ktn-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Filter Row */
.ktn-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    background: #ffffff;
    padding: 30px;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.ktn-sub-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.ktn-sub-tab {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.ktn-sub-tab.active {
    background: #111;
    color: #fff;
}

.ktn-search-box {
    position: relative;
    flex: 1.5;
    min-width: 320px;
}

.ktn-search-box input {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 45px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

.ktn-search-box input:focus {
    border-color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.ktn-search-box .dashicons {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

.ktn-dropdown-wrapper {
    flex: 1;
    min-width: 220px;
}

.ktn-select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 15px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    background-color: #fff !important;
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 18px !important;
    transition: all 0.2s ease !important;
}

.ktn-select:focus {
    border-color: #0f172a !important;
    outline: none !important;
}

.ktn-select:disabled {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

/* Results Grid Layout */
.ktn-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

/* Movie specific grid (smaller cards, more columns) */
#tab-movies .ktn-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.ktn-tab-panel {
    display: none;
    position: relative;
    min-height: 400px;
}

.ktn-tab-panel.active {
    display: block;
}

/* Loader Overlay - Localized to the results area */
.ktn-guides-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 10;
    display: flex;
    align-items: flex-start; justify-content: center;
    padding-top: 100px;
    border-radius: 20px;
}

.ktn-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0f172a;
    border-radius: 50%;
    animation: ktn-spin 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes ktn-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ktn-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    color: #64748b;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 1024px) {
    .ktn-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .ktn-guides-header h1 {
        font-size: 28px;
    }
    .ktn-filter-row {
        padding: 20px;
        gap: 15px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .ktn-search-box {
        min-width: 100%;
        order: -1;
    }
    .ktn-dropdown-wrapper {
        min-width: 100%;
    }
    .ktn-sub-tabs {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .ktn-sub-tab {
        flex: 1;
        min-width: 80px;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .ktn-guides-container {
        padding: 0 15px;
        margin: 20px auto;
    }
    .ktn-guides-tabs {
        width: 90%;
        max-width: 400px;
    }
    .ktn-tab-btn {
        padding: 8px 15px;
        font-size: 14px;
        flex: 1;
    }
    
    .ktn-results-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    #tab-movies .ktn-results-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 450px) {
    /* Tight squeeze on mobile, simplify to 1 column if too narrow? 
       Prompt said 2 per row even on mobile. Let's keep 2 but reduce padding. */
    .ktn-results-grid {
        gap: 10px !important;
    }
}

