/* Custom CSS for Chess Video Creator */

:root {
    --primary-color: #204C8D;
    --primary-light: #3d6ba8;
    --primary-lighter: #5a8ac3;
    --primary-dark: #1a3d6f;
    --primary-darker: #0f2a4d;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

/* Mobile-first responsive adjustments */
@media (max-width: 1180px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
}

/* Navigation Enhancements */
.navbar {
    box-shadow: var(--box-shadow);
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
}

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

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

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Mobile Navigation Fixes */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #212529;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        background-color: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }
    
    .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.85);
        padding: 0.75rem 1rem;
    }
    
    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .navbar-toggler {
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 0.25rem 0.5rem;
        outline: none;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        width: 1.5em;
        height: 1.5em;
    }
    
    /* Fix for Sign Up button on mobile */
    .navbar-nav .btn-primary {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
}

/* Ensure navbar toggler is visible on mobile */
.navbar-toggler {
    display: block;
}

@media (min-width: 992px) {
    .navbar-toggler {
        display: none;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

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

/* Feature Cards */
.feature-icon {
    color: var(--primary-color);
}

.card {
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

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

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-icon {
    color: var(--primary-color);
}

.stats-icon i {
    opacity: 0.8;
}

/* Step Numbers */
.step-number .badge {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Pricing Cards */
.pricing-section .card {
    border: 2px solid transparent;
}

.pricing-section .card:hover {
    border-color: var(--primary-color);
}

.price .display-6 {
    font-weight: 700;
    color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius);
}

/* Dashboard Specific Styles */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius);
}

.quick-actions .btn {
    min-height: 120px;
    transition: all 0.3s ease;
}

.quick-actions .btn:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow-lg);
}

/* Video Status Badges */
.video-status-badge .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Game Result Badges */
.game-result-badge .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Progress Bars */
.progress {
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 1rem;
}

/* Form Enhancements */
.form-control {
    border-radius: var(--border-radius);
    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(32, 76, 141, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Button Enhancements */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

/* Alert Enhancements */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

/* Footer */
footer {
    margin-top: 3rem;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* Mobile-specific enhancements */
@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .quick-actions .btn {
        min-height: 100px;
        font-size: 0.9rem;
    }
    
    .stats-icon i {
        font-size: 2rem !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tablet-specific enhancements */
@media (min-width: 577px) and (max-width: 991px) {
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .quick-actions .btn {
        min-height: 110px;
    }
}

/* Large screen enhancements */
@media (min-width: 992px) {
    .hero-section {
        padding: 4rem 2rem !important;
    }
    
    .quick-actions .btn {
        min-height: 130px;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in up animation for scroll-triggered elements */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }
.fade-in-delay-7 { transition-delay: 0.7s; }
.fade-in-delay-8 { transition-delay: 0.8s; }
.fade-in-delay-9 { transition-delay: 0.9s; }

/* Feature card enhancements */
.feature-card {
    transition: all 0.3s ease;
}

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

.feature-image {
    transition: transform 0.5s ease;
}

.feature-card:hover .feature-image {
    transform: scale(1.05);
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Hover effects for interactive elements */
.interactive-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

/* 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 var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Chess Board Customization Styles */
.chess-board {
    width: 400px;
    height: 400px;
    border: 2px solid #333;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.chess-board.preview-board {
    width: 200px;
    height: 200px;
    border: 1px solid #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chess-square {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.3s ease;
}

.chess-piece {
    width: 80%;
    height: 80%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.chess-piece:hover {
    transform: scale(1.05);
}

.preview-board .chess-piece {
    width: 70%;
    height: 70%;
}

.chess-piece.piece-theme-default {
    filter: none;
}

.chess-piece.piece-theme-modern {
    filter: hue-rotate(185deg) saturate(1.25);
}

.chess-piece.piece-theme-classic {
    filter: sepia(0.55) saturate(0.95) brightness(1.05);
}

.chess-piece.piece-theme-minimal {
    filter: grayscale(1) brightness(1.2) contrast(1.1);
}

.chess-square.light {
    background-color: #F0D9B5;
}

.chess-square.dark {
    background-color: #B58863;
}

.chess-square.coordinates {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
}

.preview-board .chess-square.coordinates {
    font-size: 8px;
}

.theme-preset {
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.theme-preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-control-color {
    width: 100%;
    height: 38px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    cursor: pointer;
}

.form-control-color:hover {
    border-color: #86b7fe;
}

.customization-controls .form-label {
    font-weight: 600;
    color: #495057;
}

.chess-board-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-board-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

/* Responsive adjustments */
@media (max-width: 1180px) {
    .chess-board {
        width: 300px;
        height: 300px;
    }
    
    .chess-board.preview-board {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 576px) {
    .chess-board {
        width: 250px;
        height: 250px;
    }
    
    .chess-board.preview-board {
        width: 120px;
        height: 120px;
    }
}

/* Music timing controls animations and styling */
@keyframes fadeInHighlight {
    0% {
        opacity: 0.7;
        transform: translateY(-5px);
        box-shadow: 0 0 0 rgba(32, 76, 141, 0);
    }
    50% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 20px rgba(32, 76, 141, 0.3);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 0 rgba(32, 76, 141, 0);
    }
}

#musicTimingControls {
    transition: all 0.3s ease-in-out;
}

#musicTimingControls .card {
    border-left: 4px solid var(--primary-color) !important;
}

#musicTimingControls .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Enhanced music selection styling */
.music-selection-card .music-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.music-selection-card .music-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.music-selection-card .music-card.border-primary {
    border-width: 3px !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 76, 141, 0.25);
}

/* Music timing input styling */
#musicTimingControls .form-control,
#musicTimingControls .form-select {
    border-color: #dee2e6;
    transition: border-color 0.3s ease;
}

#musicTimingControls .form-control:focus,
#musicTimingControls .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(32, 76, 141, 0.25);
}

#musicTimingControls .form-range {
    height: 38px;
    padding: 0;
}

#musicTimingControls .input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Music timing tips styling */
#musicTimingControls .alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

#musicTimingControls .alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.2);
    color: #055160;
}

#musicTimingControls .alert-info .bi-lightbulb {
    color: #0dcaf0;
}

#musicTimingControls .alert-info ul {
    padding-left: 1.2rem;
}

#musicTimingControls .alert-info li {
    margin-bottom: 0.25rem;
}

/* Enhanced music selection controls */
.music-preview-controls {
    margin-top: 0.5rem;
}

.music-preview-controls .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.music-meta .badge {
    font-size: 0.7rem;
}

.music-icon {
    transition: transform 0.3s ease;
}

.music-selection-card:hover .music-icon {
    transform: scale(1.1);
}

/* Music card selection states */
.music-card.border-primary {
    border-width: 3px !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 76, 141, 0.25);
    transform: translateY(-2px);
}

.music-card.border-primary .music-icon {
    color: var(--primary-color) !important;
}

/* Music Player & Trimming Interface Styles */
#musicPlayerInterface {
    transition: all 0.3s ease-in-out;
}

#musicPlayerInterface .card {
    border-left: 4px solid var(--primary-color) !important;
}

#musicPlayerInterface .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Audio Player Container */
.audio-player-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.audio-player-container audio {
    border-radius: 6px;
}

/* Waveform Container */
.waveform-container {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
}

#waveformCanvas {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 6px;
    cursor: crosshair;
}

.waveform-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
}

/* Trim Handles */
.trim-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    cursor: ew-resize;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 0 8px rgba(32, 76, 141, 0.5);
}

.trim-handle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    right: -3px;
    bottom: -5px;
    background: rgba(32, 76, 141, 0.1);
    border-radius: 4px;
}

.trim-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.trim-start {
    left: 0;
}

.trim-end {
    right: 0;
}

/* Trim Selection */
.trim-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(32, 76, 141, 0.1);
    border: 1px solid rgba(32, 76, 141, 0.3);
    pointer-events: none;
    z-index: 5;
}

/* Waveform Controls */
.waveform-controls {
    text-align: center;
    color: #6c757d;
}

/* Trim Controls Styling */
#musicPlayerInterface .form-control,
#musicPlayerInterface .form-select {
    border-color: #dee2e6;
    transition: border-color 0.3s ease;
}

#musicPlayerInterface .form-control:focus,
#musicPlayerInterface .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(32, 76, 141, 0.25);
}

#musicPlayerInterface .form-range {
    height: 38px;
    padding: 0;
}

#musicPlayerInterface .input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Trim Duration Display */
#trimDuration {
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
}

/* Action Buttons */
#musicPlayerInterface .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

#musicPlayerInterface .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

#musicPlayerInterface .btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

/* Responsive Waveform */
@media (max-width: 1180px) {
    #waveformCanvas {
        height: 80px;
    }
    
    .trim-handle::after {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 576px) {
    #waveformCanvas {
        height: 60px;
    }
    
    .trim-handle {
        width: 3px;
    }
    
    .trim-handle::after {
        width: 8px;
        height: 8px;
    }
}





