/* ===== CSS Variables & ABACO Brand Guidelines ===== */
:root {
    --color-primary: #D2DE38; /* Verde-Limón */
    --color-secondary: #F58634; /* Naranja Símbolo */
    --color-accent: #00A859; /* Verde Hojas */
    --color-text: #5B5B5B; /* Gris oscuro para texto */
    --color-text-light: #8A8A8A; /* Gris claro */
    --color-bg-light: #F7F9FA;
    --color-white: #FFFFFF;
    
    --font-heading: 'CorporateRoundedExtraBold', 'Nunito', sans-serif;
    --font-body: 'Century Gothic', 'Montserrat', sans-serif;
    
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg-light);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-text);
}


/* ===== Hero Section ===== */
.hero {
    padding: 1.5rem 1.5rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.search-bar-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: sticky;
    top: 0;
    padding-top: 2rem;
    padding-bottom: 1.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--color-bg-light);
    z-index: 100;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--color-text-light);
}

#global-search {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    font-family: var(--font-body);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

#global-search:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(245,134,52, 0.3); /* Naranja focus */
}

/* ===== Main Dashboard ===== */
.dashboard-container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar Filters */
.sidebar-filters {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.sidebar-filters::-webkit-scrollbar {
    width: 6px;
}
.sidebar-filters::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-filters::-webkit-scrollbar-thumb {
    background-color: #e1e1e1;
    border-radius: 10px;
}
.sidebar-filters::-webkit-scrollbar-thumb:hover {
    background-color: #cccccc;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-bg-light);
    padding-bottom: 1rem;
}

.filter-header h2 {
    font-size: 1.25rem;
}

.btn-reset {
    background: none;
    border: none;
    color: var(--color-secondary);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition);
}

.btn-reset:hover {
    color: var(--color-accent);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background-color: var(--color-white);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235B5B5B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: right .7em top 50%, 0 0;
    background-size: .65em auto, 100%;
}

input[type="date"].filter-select {
    background-image: none;
    padding-right: 1rem;
}

.filter-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,168,89, 0.1);
}

.sponsor-notice {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e1e1e1;
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-align: center;
}

.sponsor-notice strong {
    color: var(--color-secondary);
    font-weight: 700;
}

/* Sort Toolbar inside results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 600;
    margin-right: 0.25rem;
}

.btn-sort {
    background-color: var(--color-bg-light);
    border: 1px solid #e1e1e1;
    color: var(--color-text);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-sort:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.btn-sort.active {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.btn-sort .sort-arrow {
    display: inline-block;
    min-width: 0.6rem;
    text-align: center;
}

/* Videos Grid */
.videos-section {
    width: 100%;
}

.results-header {
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Video Card Styles */
.video-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.video-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #000;
    cursor: pointer;
}

.video-thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    min-height: 100%;
    opacity: 0.9;
    transition: var(--transition);
}

.video-card:hover .video-thumbnail {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(245,134,52, 0.9); /* Naranja */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.video-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.video-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(210,222,56, 0.2); /* Verde Limon claro */
    color: var(--color-accent);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.meta-item strong {
    color: var(--color-text);
}

.video-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-bg-light);
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--color-white);
    width: 100%;
    max-width: 1000px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-secondary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--color-accent);
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-details {
    padding: 2rem;
}

.video-details h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.video-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar-filters {
        position: static;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}
