/* FastYT - Cached YouTube Search Interface */

:root {
    --primary: #FF0000;
    --primary-dark: #CC0000;
    --secondary: #282828;
    --bg-light: #F9F9F9;
    --bg-dark: #181818;
    --text-light: #333;
    --text-dark: #FFF;
    --border: #DDD;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo i {
    font-size: 48px;
}

.logo h1 {
    font-size: 48px;
    font-weight: 700;
}

.subtitle {
    margin-top: 10px;
    font-size: 18px;
    opacity: 0.9;
}

/* Controls */
.controls {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 20px;
}

.search-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.search-selector label {
    font-weight: 600;
    white-space: nowrap;
}

.select-dropdown {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.select-dropdown:hover {
    border-color: var(--primary);
}

.select-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.btn-refresh {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-sm {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.view-options {
    display: flex;
    gap: 5px;
}

.btn-view {
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-view.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Stats Bar */
.stats-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.stat-item i {
    color: var(--primary);
    font-size: 20px;
}

.stat-item span {
    font-weight: 700;
    color: var(--primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 10px;
    display: none;
}

.loading.show {
    display: block;
}

.loading i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Videos Container */
.videos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.videos-container.list-view {
    grid-template-columns: 1fr;
}

.video-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-channel {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.video-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.video-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-stats i {
    color: var(--primary);
}

/* List View */
.list-view .video-card {
    display: flex;
    flex-direction: row;
}

.list-view .video-thumbnail {
    width: 320px;
    padding-top: 0;
    min-height: 180px;
}

.list-view .video-info {
    flex: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-page {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-page:hover {
    background: var(--primary-dark);
}

.btn-page:disabled {
    background: #CCC;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 600;
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    z-index: 1;
}

.modal-close:hover {
    color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    background: var(--secondary);
    color: var(--text-dark);
    border-radius: 10px;
}

.footer p {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 32px;
    }

    .logo i {
        font-size: 32px;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .videos-container {
        grid-template-columns: 1fr;
    }

    .list-view .video-card {
        flex-direction: column;
    }

    .list-view .video-thumbnail {
        width: 100%;
        padding-top: 56.25%;
    }

    .stats-bar {
        flex-direction: column;
        text-align: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error {
    background: #FFF3CD;
    border: 2px solid #FFC107;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
}
