/* ========================================
   RESET & BASE - Style Google Material
   ======================================== */

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #ffffff;
    color: #202124;
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HEADER - Style Google épuré
   ======================================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

/* Logo minimaliste */
.logo-text {
    font-size: 22px;
    font-weight: 400;
    color: #202124;
    margin: 0;
}

.logo a {
    text-decoration: none;
    color: #202124;
}

.logo a:hover {
    text-decoration: none;
}

/* Navigation épurée */
.main-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f1f3f4;
    text-decoration: none;
    color: #202124;
}

.main-nav .search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
}

.main-nav .search-btn:hover {
    background-color: #f1f3f4;
    color: #202124;
}

/* Sélecteur langue simple */
.lang-selector {
    position: relative;
}

.lang-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

.lang-btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #202124;
    text-decoration: none;
    font-size: 14px;
}

.lang-option:hover {
    background: #f1f3f4;
}

.lang-option.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.lang-option strong {
    min-width: 28px;
    color: #5f6368;
    font-size: 12px;
}

/* ========================================
   VIDEO GRID - Cards Google Material
   ======================================== */

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

/* Video Card épurée */
.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.video-card:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.video-card a {
    display: block;
    color: #202124;
    text-decoration: none;
}

/* Thumbnail container */
.video-thumb,
.video-thumb-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #f8f9fa;
}

.video-thumb img,
.video-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Video Preview */
.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    background: #000;
    pointer-events: none;
}

/* Duration badge */
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    z-index: 3;
}

/* Video info */
.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 400;
    color: #030303;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.video-tags-inline {
    font-size: 12px;
    color: #606060;
    margin-bottom: 4px;
}

/* ========================================
   SORT BAR - Style Google
   ======================================== */

.sort-bar {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    border-bottom: 1px solid #e8eaed;
}

.sort-buttons {
    display: flex;
    gap: 0;
}

.sort-link {
    padding: 12px 24px;
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sort-link:hover {
    color: #202124;
    text-decoration: none;
}

.sort-link.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* ========================================
   PAGINATION - Style Google
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 32px 0;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.page-link:hover {
    background-color: #f1f3f4;
    text-decoration: none;
}

.page-link.active {
    background-color: #1a73e8;
    color: #fff;
}

.pagination span {
    color: #5f6368;
    padding: 0 8px;
}

/* ========================================
   PAGE VIDÉO - Style Google
   ======================================== */

.video-page {
    max-width: 1280px;
    margin: 0 auto;
}

.video-player-wrapper {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin: 24px 0;
}

.video-details {
    padding: 20px 0;
}

.video-title-main {
    font-size: 20px;
    font-weight: 400;
    color: #030303;
    margin-bottom: 8px;
}

/* Tags vidéo - Pills Google */
.video-tags-section {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.video-tags-section::-webkit-scrollbar {
    display: none;
}

.video-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f1f3f4;
    border-radius: 16px;
    color: #202124;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.video-tag-pill:hover {
    background: #e8eaed;
    text-decoration: none;
}

.tag-icon {
    width: 12px;
    height: 12px;
}

/* Video stats */
.video-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
    color: #606060;
    font-size: 13px;
}

.stat-item {
    display: flex;
    gap: 4px;
}

.stat-label {
    color: #606060;
}

.stat-value {
    color: #030303;
    font-weight: 500;
}

/* Description collapsible */
.video-description-wrapper {
    position: relative;
    margin: 16px 0;
}

.video-description {
    color: #606060;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.video-description.collapsed {
    max-height: 80px;
    position: relative;
}

.video-description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, white);
}

.video-description.expanded {
    max-height: 2000px;
}

.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
}

.show-more-btn:hover {
    background: #f1f3f4;
}

.show-more-icon {
    transition: transform 0.3s;
    font-size: 12px;
}

.show-more-btn.expanded .show-more-icon {
    transform: rotate(180deg);
}

/* ========================================
   PAGE HEADERS - Minimaliste
   ======================================== */

.page-header-compact {
    text-align: left;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}

.page-title-compact {
    font-size: 22px;
    font-weight: 400;
    color: #202124;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.video-count {
    font-size: 14px;
    font-weight: 400;
    color: #5f6368;
}

.page-header {
    text-align: center;
    padding: 24px 0;
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 8px;
}

.page-description {
    font-size: 14px;
    color: #5f6368;
}

/* ========================================
   SEARCH MODAL - Google Material
   ======================================== */

.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
}

.search-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 720px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    z-index: 9999;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8eaed;
}

.search-modal-title {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin: 0;
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #5f6368;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-modal-close:hover {
    background: #f1f3f4;
}

/* Search form Google style */
.search-form-modal {
    padding: 24px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input-modern {
    width: 100%;
    padding: 14px 56px 14px 16px;
    font-size: 16px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
}

.search-input-modern:focus {
    border-color: #1a73e8;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-btn-modern {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #1a73e8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-btn-modern:hover {
    background: #1765cc;
}

.search-icon-modern {
    font-size: 20px;
    filter: brightness(0) invert(1);
}

/* Suggestions */
.search-suggestions {
    padding: 0;
}

.suggestions-title {
    font-size: 12px;
    color: #5f6368;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    padding: 8px 16px;
    background: #f1f3f4;
    border-radius: 16px;
    color: #202124;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.suggestion-tag:hover {
    background: #e8eaed;
    text-decoration: none;
}

/* ========================================
   TAGS PAGE - Google Cards
   ======================================== */

.tags-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.tag-page-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-page-card:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    text-decoration: none;
}

.tag-rank {
    font-size: 18px;
    font-weight: 500;
    color: #5f6368;
    min-width: 40px;
}

.tag-info {
    flex: 1;
}

.tag-name {
    font-size: 16px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 4px;
}

.tag-count {
    font-size: 13px;
    color: #5f6368;
}

.tag-count-number {
    font-weight: 500;
}

.tag-arrow {
    color: #5f6368;
    font-size: 18px;
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

.search-results-header {
    padding: 16px 0;
    margin-bottom: 16px;
}

.results-count {
    font-size: 14px;
    color: #5f6368;
    margin: 0;
}

.results-count strong {
    color: #202124;
    font-weight: 500;
}

/* ========================================
   LOADING INDICATOR
   ======================================== */

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #5f6368;
    font-size: 14px;
}

.loading-spinner {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   MOBILE TOP NAV - Material
   ======================================== */

.mobile-top-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-top-nav {
        display: flex;
        position: sticky;
        top: 0;
        background: #fff;
        border-bottom: 1px solid #e8eaed;
        box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
        z-index: 999;
        padding: 8px;
        gap: 8px;
        justify-content: space-around;
    }
    
    .mobile-top-nav.not-sticky {
        position: relative;
    }
    
    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        background: none;
        border: none;
        color: #5f6368;
        font-size: 11px;
        font-weight: 500;
        cursor: pointer;
        border-radius: 4px;
    }
    
    .mobile-nav-btn:active {
        background: #f1f3f4;
    }
    
    .mobile-nav-icon {
        font-size: 20px;
    }
    
    .mobile-nav-label {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* ========================================
   MOBILE POPOVERS - Material Bottom Sheets
   ======================================== */

.mobile-popover {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
}

.mobile-popover.show {
    display: flex;
    align-items: flex-end;
}

.mobile-popover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.mobile-popover-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e8eaed;
}

.mobile-popover-title {
    font-size: 18px;
    font-weight: 400;
    color: #202124;
    margin: 0;
}

.mobile-popover-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #5f6368;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.mobile-popover-close:hover {
    background: #f1f3f4;
}

.mobile-popover-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Language items */
.mobile-lang-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: #202124;
}

.mobile-lang-item:active {
    background: #f1f3f4;
}

.mobile-lang-item.active {
    background: #e8f0fe;
}

.mobile-lang-code {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    min-width: 28px;
}

.mobile-lang-name {
    flex: 1;
    font-size: 14px;
}

.mobile-lang-check {
    font-size: 18px;
    color: #1a73e8;
}

/* Tag items */
.mobile-tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: #202124;
}

.mobile-tag-item:active {
    background: #f1f3f4;
}

.mobile-tag-item.all-tags {
    background: #1a73e8;
    color: #fff;
    margin-bottom: 12px;
}

.mobile-tag-name {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
}

.mobile-tag-count {
    font-size: 12px;
    color: #1a73e8;
    font-weight: 500;
    background: #e8f0fe;
    padding: 4px 8px;
    border-radius: 12px;
}

.mobile-tag-item.all-tags .mobile-tag-name,
.mobile-tag-item.all-tags .mobile-tag-count {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   MOBILE BOTTOM NAV - Material
   ======================================== */

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e8eaed;
        box-shadow: 0 -1px 6px rgba(32, 33, 36, 0.28);
        z-index: 1000;
        padding: 8px;
        gap: 8px;
    }
    
    .mobile-sort {
        display: flex;
        gap: 4px;
        flex: 1;
    }
    
    .sort-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 8px;
        text-decoration: none;
        color: #5f6368;
        font-size: 10px;
        border-radius: 4px;
        flex: 1;
    }
    
    .sort-item.active {
        background: #e8f0fe;
        color: #1a73e8;
    }
    
    .sort-icon {
        font-size: 16px;
    }
    
    .sort-label {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .mobile-pagination {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .page-nav-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        color: #1a73e8;
        text-decoration: none;
        border: 1px solid #dadce0;
        border-radius: 4px;
        font-size: 13px;
    }
    
    .page-nav-btn:active {
        background: #f1f3f4;
    }
    
    .page-nav-btn.disabled {
        opacity: 0.3;
        pointer-events: none;
    }
    
    .page-current {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        height: 36px;
        padding: 0 12px;
        background: #1a73e8;
        color: #fff;
        border-radius: 4px;
        font-size: 13px;
        font-weight: 500;
    }
    
    .main-content {
        padding-bottom: 70px;
    }
}

/* ========================================
   FOOTER - Minimaliste
   ======================================== */

.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    padding: 24px 0;
    margin-top: 48px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-links a {
    color: #5f6368;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: #1a73e8;
    background: #f1f3f4;
    text-decoration: none;
}

.footer-bottom {
    color: #5f6368;
    font-size: 13px;
}

.footer-bottom p {
    margin: 0;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}

/* ========================================
   RESPONSIVE - Google Mobile First
   ======================================== */

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .lang-selector {
        display: none;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .sort-bar {
        display: none;
    }
    
    .pagination {
        display: none;
    }
}

@media (max-width: 413px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: #5f6368;
}

.back-link {
    display: inline-block;
    margin: 24px 0;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.related-section {
    margin-top: 32px;
}

.related-title {
    font-size: 18px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 16px;
}

