/* Enhanced User Experience Styles */

/* Video Cards Grid Fix - Prevent Overlapping */
.video-card {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.video-card img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Improved card hover effects */
.movie-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

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

.movie-card:focus {
    outline: 2px solid #01b4e4;
    outline-offset: 2px;
}

/* Improved focus states for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(1, 180, 228, 0.25);
}

/* Better loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #01b4e4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Improved notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #2d3748 !important;
    }
    
    .text-dark {
        color: #e2e8f0 !important;
    }
    
    .card {
        background-color: #4a5568;
        border-color: #718096;
    }
    
    .card-title {
        color: #e2e8f0 !important;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
}

/* Improved responsive design */
@media (max-width: 576px) {
    .movie-card {
        margin-bottom: 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
}

/* Better form styling */
.form-control:focus {
    border-color: #01b4e4;
    box-shadow: 0 0 0 0.2rem rgba(1, 180, 228, 0.25);
}

/* Improved button states */
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(1, 180, 228, 0.3);
}

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

.visually-hidden-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #01b4e4;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1070;
    transition: top 0.3s;
}

.skip-nav:focus {
    top: 6px;
}

/* Improved search form */
.search-form {
    position: relative;
}

.search-form .form-control {
    padding-right: 50px;
}

.search-form .btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0 25px 25px 0;
}

/* Better error states */
.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.has-success .form-control {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Enhanced Rating Cards */
.ratings-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rating-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

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

.rating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #01b4e4, #90cea1);
}

.rating-card.excellent::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.rating-card.good::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.rating-card.average::before {
    background: linear-gradient(90deg, #fd7e14, #dc3545);
}

.rating-card.poor::before {
    background: linear-gradient(90deg, #dc3545, #6f42c1);
}

.rating-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.rating-header i {
    font-size: 1.2em;
}

.source-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
}

.rating-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.rating-circle.excellent {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

.rating-circle.good {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: #ffc107;
    color: #856404;
}

.rating-circle.average {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #fd7e14;
    color: #721c24;
}

.rating-circle.poor {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
}

.score-number {
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.score-label {
    font-size: 0.7em;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vote-count {
    font-size: 0.6em;
    opacity: 0.7;
    margin-top: 2px;
}

.rating-value {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* TMDB Score Special Styling */
.tmdb-score .rating-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #01b4e4, #90cea1);
    border-color: #01b4e4;
    color: white;
    box-shadow: 0 0 20px rgba(1, 180, 228, 0.3);
}

.tmdb-score .rating-circle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #01b4e4, #90cea1, #01b4e4);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 2s infinite;
}

/* Rating Comparison Tooltip */
.rating-card {
    position: relative;
}

.rating-card:hover::after {
    content: attr(data-rating-info);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.rating-card:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: -5px;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Rating Cards */
@media (max-width: 768px) {
    .ratings-section {
        padding: 15px;
    }
    
    .rating-card {
        padding: 15px;
        margin-bottom: 10px;
        min-height: 180px;
    }
    
    .rating-circle {
        width: 70px;
        height: 70px;
    }
    
    .tmdb-score .rating-circle {
        width: 80px;
        height: 80px;
    }
    
    .score-number {
        font-size: 1.2em;
    }
    
    .source-name {
        font-size: 0.8em;
    }
}

@media (max-width: 576px) {
    .rating-card {
        padding: 12px;
        min-height: 160px;
    }
    
    .rating-circle {
        width: 60px;
        height: 60px;
    }
    
    .tmdb-score .rating-circle {
        width: 70px;
        height: 70px;
    }
    
    .score-number {
        font-size: 1em;
    }
    
    .rating-header {
        flex-direction: column;
        gap: 4px;
    }
}

/* Video cards responsive fix */
@media (max-width: 768px) {
    .video-card {
        margin-bottom: 1rem !important;
    }
    
    .row.g-4 > .col-12.col-sm-6.col-lg-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .video-card {
        margin-bottom: 1rem !important;
    }
    
    .row.g-4 > .col-12.col-sm-6.col-lg-4 {
        margin-bottom: 1rem;
    }
} 