/* Custom CSS for VK Video Hub */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Page Titles */
.page-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.section-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid var(--primary-color);
}

.stats-card .card-body {
    padding: 2rem 1.5rem;
}

.stats-card i {
    opacity: 0.8;
}

/* Video Cards */
.video-card {
    background: white;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.video-card:hover::before {
    opacity: 1;
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.video-thumbnail img.loaded {
    opacity: 1;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.08);
}

.no-thumbnail {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 3rem;
    opacity: 0.8;
    position: relative;
}

.no-thumbnail-text {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
    text-align: center;
}

.no-thumbnail::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="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.8) 0%, rgba(0, 123, 255, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.7);
}

.play-btn:hover::before {
    opacity: 1;
}

.video-stats {
    margin-top: 0.5rem;
}

.video-stats i {
    color: #6c757d;
    transition: color 0.3s ease;
}

.video-stats i.fa-eye:hover {
    color: #17a2b8;
}

.video-stats i.fa-heart:hover {
    color: #dc3545;
}

.video-stats i.fa-comment:hover {
    color: #28a745;
}

.video-date {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

/* Video Player */
.video-player {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-player video {
    width: 100%;
    height: auto;
    max-height: 500px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    border: none;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Video card buttons */
.video-card .btn-primary {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.video-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Pagination */
.pagination {
    margin: 0;
    padding: 0;
}

.pagination .page-link {
    border-radius: 6px;
    margin: 0 1px;
    border: 1px solid #dee2e6;
    color: #007bff;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    text-align: center;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #0056b3;
    transform: none;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: none;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 2rem 1rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .stats-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .video-thumbnail img {
        height: 150px;
    }
    
    .no-thumbnail {
        height: 150px;
        font-size: 2rem;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .video-card .btn-primary {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

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

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-scale {
    animation: slideInScale 0.8s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* New Video Badge */
.new-video {
    position: relative;
}

.new-video::after {
    content: 'НОВОЕ';
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

/* Video Player Page */
.video-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

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

/* Ensure content below video is visible */
.video-info-section {
    margin-top: 20px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.video-info-section .card-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.video-info-section .card-text {
    color: #495057;
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.video-info-section .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.video-info-section .btn {
    margin-left: 10px;
    margin-bottom: 10px;
}

/* Mobile responsiveness for video player */
@media (max-width: 768px) {
    .video-container {
        height: 250px;
    }
    
    .video-info-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    .video-info-section .card-title {
        font-size: 1.3rem;
    }
    
    .video-info-section .card-text {
        font-size: 1rem;
    }
    
    .video-info-section .btn {
        margin-left: 0;
        margin-right: 10px;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .video-info-section .video-actions {
        text-align: center;
    }
    
    /* Mobile navigation */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile video cards */
    .video-card {
        margin-bottom: 1rem;
    }
    
    .video-thumbnail {
        height: 180px;
    }
    
    .video-card .card-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .video-stats {
        font-size: 0.8rem;
    }
    
    .video-stats i {
        font-size: 0.7rem;
    }
    
    /* Mobile filters */
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    /* Mobile theme toggle */
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle i {
        font-size: 1rem;
    }
    
    /* Mobile stats cards */
    .stats-card .card-body {
        padding: 1rem;
    }
    
    .stats-card i {
        font-size: 2rem !important;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    /* Mobile page titles */
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Mobile search */
    .input-group {
        margin-bottom: 1rem;
    }
    
    /* Mobile tables */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile pagination */
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 35px;
    }
    
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        padding: 0.4rem 0.8rem;
    }
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .navbar {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .card-title {
    color: var(--text-primary);
}

[data-theme="dark"] .card-text {
    color: var(--text-secondary);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-tertiary);
    border-color: #007bff;
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

[data-theme="dark"] .form-select {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .video-stats i {
    color: var(--text-muted);
}

[data-theme="dark"] .video-stats i.fa-eye:hover {
    color: #17a2b8;
}

[data-theme="dark"] .video-stats i.fa-heart:hover {
    color: #dc3545;
}

[data-theme="dark"] .video-stats i.fa-comment:hover {
    color: #28a745;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #007bff 0%, #0056b3 100%) 1;
}
