/* Reviewphim - Video Review Platform Styles */

:root {
    --primary-bg: #0d1117;
    --secondary-bg: #161b22;
    --card-bg: rgba(255, 255, 255, 0.05);
    --warning: #ffc107;
    --warning-dark: #f57c00;
    --success: #28a745;
    --danger: #dc3545;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --text-light: #c9d1d9;
    --text-muted: #8b949e;
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(13, 17, 23, 0.95) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--warning) !important;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 160px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,193,7,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,193,7,0.1)"/><circle cx="75" cy="25" r="1" fill="rgba(255,193,7,0.05)"/><circle cx="25" cy="75" r="1" fill="rgba(255,193,7,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.min-vh-50 {
    min-height: 50vh;
}

.hero-video-placeholder {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 3rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* Cards and Components */

/* 5 cột trên màn hình lớn - Custom grid class */
@media (min-width: 1200px) {
    .col-5-per-row {
        flex: 0 0 20%;
        max-width: 20%;
        padding-right: 7.5px;
        padding-left: 7.5px;
    }
}

.thumbnail-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.thumbnail-link:hover {
    text-decoration: none;
    color: inherit;
}

.review-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
}

.review-thumbnail {
    position: relative;
    overflow: hidden;
}

.review-thumbnail img {
    width: 100%;
    height: 100px; /* Chiều cao chuẩn 100px - gọn gàng */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.review-card:hover .review-thumbnail img {
    transform: scale(1.05);
}

.facebook-thumbnail {
    height: 100px; /* Chiều cao chuẩn 100px - gọn gàng */
    background: linear-gradient(135deg, #4267B2 0%, #365899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.placeholder-thumbnail {
    height: 100px; /* Chiều cao chuẩn 100px - gọn gàng */
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--card-bg) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px dashed var(--border-color);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 55px; /* Tăng từ 50px lên 55px */
    height: 55px; /* Tăng từ 50px lên 55px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem; /* Tăng từ 1.2rem lên 1.3rem */
    transition: all 0.3s ease;
}

.play-button:hover {
    background: var(--warning);
    color: black;
    transform: translate(-50%, -50%) scale(1.1);
}

.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 193, 7, 0.9);
    color: black;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.review-content {
    padding: 1.2rem; /* Tăng từ 1rem lên 1.2rem */
}

.review-title {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    line-height: 1.3;
    
    /* 🔥 CẮT NGẮN 1 DÒNG VỚI DẤU ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.movie-title {
    color: var(--warning);
    font-weight: 500;
    margin-bottom: 0.5rem;
    
    /* 🔥 CẮT NGẮN TÊN PHIM 1 DÒNG VỚI DẤU ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.reviewer-name {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    
    /* 🔥 CẮT NGẮN TÊN REVIEWER 1 DÒNG VỚI DẤU ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
}

.review-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    
    /* 🔥 CẮT NGẮN MÔ TẢ 2 DÒNG VỚI DẤU ... */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.review-meta {
    padding: 0 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Video Player */
.video-player-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}

/* VIDEO CONTAINER - FORCE RESPONSIVE FIX */
.video-container {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    overflow: hidden !important;
    background: #000 !important;
}

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

/* FORCE FIX CHO FACEBOOK & YOUTUBE */
.video-container iframe[src*="facebook.com"],
.video-container iframe[src*="youtube.com"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.video-error {
    padding: 3rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 15px;
}

.demo-video-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.video-info-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
}

.video-title {
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
}

.rating-large {
    font-size: 1.2rem;
}

.video-meta .meta-item {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.video-description {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.video-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
}

.sidebar-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.related-video-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.3s ease;
}

.related-video-item:last-child {
    border-bottom: none;
}

.related-video-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Featured Section */
.featured-section {
    background: rgba(255, 193, 7, 0.05);
    position: relative;
}

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

/* Search Results */
.search-header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
}

.no-results {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.advanced-search-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
}

/* Buttons */
.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: black;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.btn-outline-warning {
    border-color: var(--warning);
    color: var(--warning);
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background: var(--warning);
    border-color: var(--warning);
    color: black;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: var(--primary-bg) !important;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Admin Styles */
.admin-header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    color: var(--warning);
}

.stat-info h3 {
    color: white;
    font-weight: bold;
    margin: 0;
    font-size: 2rem;
}

.stat-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.admin-table-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
}

.table-dark {
    --bs-table-bg: transparent;
}

.table-dark td, .table-dark th {
    border-color: var(--border-color);
}

.video-thumbnail {
    width: 50px;
    height: 28px;
    object-fit: cover;
    border-radius: 5px;
}

.video-title-cell {
    display: flex;
    align-items: center;
    max-width: 250px;
}

/* Forms */
.form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--warning);
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    color: white;
}

.form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
}

.form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--warning);
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    color: white;
}
/* Fix dropdown options visibility */
.form-select option {
    background-color: #2d3748 !important;
    color: white !important;
    padding: 8px 12px;
}

.form-select option:hover,
.form-select option:checked,
.form-select option:focus {
    background-color: #4a5568 !important;
    color: white !important;
}

/* Alternative solution for better browser compatibility */
.form-select {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.form-select option {
    background: #2d3748 !important;
    color: white !important;
}
.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-card {
    animation: fadeInUp 0.6s ease-out;
}

.review-card:nth-child(2) {
    animation-delay: 0.1s;
}

.review-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Responsive Design - FORCE FIX MOBILE VIDEO */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    /* FORCE FIX: Video container cho mobile */
    .video-player-section .video-container {
        padding-bottom: 56.25% !important; /* Giữ 16:9 thay vì 75% */
        max-height: 60vh !important; /* Giới hạn chiều cao */
        margin-bottom: 1rem !important;
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    .video-player-section .video-container iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
    }
    
    /* Video player section */
    .video-player-section {
        margin-bottom: 1.5rem !important;
        overflow: hidden !important;
    }
    
    .review-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* FORCE FIX cho màn hình rất nhỏ */
@media (max-width: 480px) {
    .video-player-section .video-container {
        padding-bottom: 56.25% !important; /* Giữ 16:9 */
        max-height: 55vh !important;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* FORCE FIX cho landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .video-player-section .video-container {
        padding-bottom: 45% !important; /* Thấp hơn cho landscape */
        max-height: 70vh !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--warning);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--warning-dark);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.4), transparent);
    animation: shimmer 2s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--warning);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --card-bg: rgba(255, 255, 255, 0.1);
        --border-color: rgba(255, 255, 255, 0.3);
    }
}