@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Roboto:wght@300;400;500&family=Merriweather:wght@300;400;700&display=swap');

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    background: linear-gradient(135deg, #FF6B35 0%, #FF7F47 25%, #FF9500 50%, #FFAB32 75%, #FF8C00 100%);
}

.splash-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.splash-image {
    width: 90vw;
    height: 50vh;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
    animation: splash-heartbeat 1.5s infinite ease-in-out;
    transform-origin: center center;
}

@keyframes splash-heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.05); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
    60% { transform: scale(1); }
    75% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.main-content {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    color: #343a40;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

.app-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #FF6B35;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
    letter-spacing: -0.5px;
}

.app-logo {
    height: 90px;
    width: 180px;
    margin: 0 10px;
    transform-origin: center center;
    object-fit: contain;
}

@keyframes logo-heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Specific styling for login page logos */
.app-logo-sliding {
    height: 40px;
    width: 80px;
    transform-origin: center center;
    object-fit: contain;
}



/* Animation for mobile - reduced movement */
@media screen and (max-width: 767px) {
    @keyframes logo-flip {
        0% { transform: translateX(-10px) rotateX(0deg); }
        25% { transform: translateX(0px) rotateX(180deg); }
        50% { transform: translateX(10px) rotateX(360deg); }
        75% { transform: translateX(0px) rotateX(540deg); }
        100% { transform: translateX(-10px) rotateX(720deg); }
    }
    
    /* Compact 4-step windows for mobile vertical with uniform height */
    .how-it-works-section .row {
        display: flex !important;
        align-items: stretch !important;
    }
    
    .how-it-works-section .col-3 {
        display: flex !important;
    }
    
    .how-it-works-section .col-3 .text-center {
        padding: 1px 1px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        flex: 1 !important;
        min-height: 100% !important;
    }
    
    .how-it-works-section .col-3 h6 {
        font-size: 0.54rem !important;
        line-height: 1.0 !important;
        margin-bottom: 2px !important;
        flex-grow: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .how-it-works-section .col-3 .badge {
        font-size: 0.45rem !important;
        margin-bottom: 2px !important;
    }
    
    .how-it-works-section .col-3 .d-flex {
        width: 30px !important;
        height: 30px !important;
        margin-bottom: 2px !important;
    }
    
    .how-it-works-section .col-3 .d-flex i {
        font-size: 0.8rem !important;
    }
}

.app-title i {
    color: #FF6B35;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin: 0 10px;
}

.card-body p.text-muted {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    color: #6c757d;
    letter-spacing: 0.2px;
    opacity: 0.8;
}

/* Stile paragrafi giustificati */
.text-justify {
    text-align: justify !important;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.video-container video,
.video-container canvas {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    z-index: 1000;
    display: none;
}

.recording-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #333;
    font-weight: 500;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
}

.recording-indicator.d-none {
    display: none !important;
}

.recording-timer {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 40px;
    text-align: center;
    opacity: 0.8;
    margin-left: 4px;
}

.record-dot {
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* UNIFORM BUTTON DIMENSIONS - Same size on all devices */
.btn {
    font-size: 0.9rem !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
}

/* Small button size variant - uniform across devices */
.btn-sm {
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
    min-height: 36px !important;
    gap: 6px !important;
}

/* Large button size variant - uniform across devices */
.btn-lg {
    font-size: 1rem !important;
    padding: 16px 24px !important;
    min-height: 52px !important;
    gap: 10px !important;
}

/* Icon spacing inside buttons */
.btn i {
    margin-right: 0 !important;
    line-height: 1 !important;
}

/* Container spacing for button groups */
.d-grid.gap-2 {
    gap: 12px !important;
}

.d-grid.gap-3 {
    gap: 16px !important;
}

/* Consistent spacing between inline buttons */
.btn + .btn {
    margin-left: 8px !important;
}
}

/* Password input and regeneration button layout */
#preRecordingCodeContainer .d-flex {
    display: flex !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

#customPassword {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
}

#generateRandomPassword {
    flex: 0 0 auto !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    color: #6c757d !important;
    border-radius: 50% !important;
    position: relative !important;
}

#generateRandomPassword:hover {
    color: #FF6B35 !important;
    transition: all 0.3s ease;
}

#generateRandomPassword:hover i {
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transition: all 0.3s ease;
}

#generateRandomPassword i {
    font-size: 0.9rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Password section - uniform across all devices */
#preRecordingCodeContainer .d-flex {
    gap: 8px !important;
}

#generateRandomPassword {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
}

#customPassword {
    font-size: 0.9rem !important;
}

/* Welcome Message Unroll Animation */
.welcome-message {
    position: relative;
    overflow: hidden;
    animation: welcomeUnroll 1.5s ease-out forwards;
    opacity: 0;
    transform: translateX(-100%);
}

@keyframes welcomeUnroll {
    0% {
        opacity: 0;
        transform: translateX(-100%);
        max-width: 0;
    }
    20% {
        opacity: 0.3;
        max-width: 20%;
    }
    50% {
        opacity: 0.7;
        max-width: 60%;
        transform: translateX(-20%);
    }
    80% {
        opacity: 0.9;
        max-width: 90%;
        transform: translateX(-5%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        max-width: 100%;
    }
}

/* Delayed animation start after splash screen */
.main-content .welcome-message {
    animation-delay: 0.8s;
}

/* Enhanced text clarity for video cards */
.video-item .card-title {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.video-item .card-text {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.4;
}

.video-item .card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
}

/* Improve text contrast on video cards */
.video-item h6 {
    color: #212529 !important;
    font-weight: 600 !important;
}

.video-item .card-text {
    color: #495057 !important;
}

.video-item .text-muted {
    color: #6c757d !important;
}

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn:active {
    transform: scale(0.98);
}

.alert {
    background-color: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: #343a40;
}

.camera-switch-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 1000 !important;
    background: rgba(255, 152, 0, 0.9) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    color: white !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
    visibility: visible !important;
}

.camera-switch-btn:hover {
    background: rgba(255, 152, 0, 1) !important;
    transform: scale(1.2) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
}

.video-info-banner {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Montserrat', sans-serif;
    color: #343a40;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
}

.video-info-banner .fw-bold {
    color: #FF6B35;
    font-size: 0.9rem;
}

/* Stili aggiuntivi per la pagina di ricerca video */
.search-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.search-section h4 {
    color: #FF6B35;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.search-section .text-muted {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    opacity: 0.75;
}

#videoCode, #videoPassword {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #343a40;
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    padding: 0.75rem 1rem;
    height: auto;
    border-radius: 6px;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#videoCode::placeholder, #videoPassword::placeholder {
    color: #adb5bd;
    font-weight: 300;
}

#videoCode:focus, #videoPassword:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
    border-color: #FF6B35;
    outline: none;
}

.input-group-text {
    background-color: #FF6B35;
    border: 1px solid #FF6B35;
    padding: 0.75rem 1rem;
}

.input-group-text i {
    color: #ffffff;
}

.input-group .btn {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background-color: #FF6B35;
    border-color: #FF6B35;
}

.input-group .btn:hover {
    background-color: #FF9500;
    border-color: #FF9500;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-color: #FF6B35;
}

.input-group .form-control {
    border-right: 1px solid #FF6B35;
    border-left: none;
    background-color: #ffffff;
    color: #343a40;
}

/* Speds gradient button with icon styling */
.btn[style*="linear-gradient"] i {
    color: white !important;
}

/* Force gradient styling over Bootstrap defaults */
.btn[style*="linear-gradient"]:hover {
    background: linear-gradient(135deg, #FF6B35 0%, #FF9500 100%) !important;
    opacity: 0.9;
}

/* Keep spinner color consistent */
.spinner-border {
    width: 3rem;
    height: 3rem;
    color: #FF6B35;
}

/* Override previous button styling - uniform dimensions for all devices */
.btn {
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    letter-spacing: 0.2px !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.btn:active:not(:disabled) {
    transform: translateY(0px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Primary buttons with speds gradient */
.btn-primary,
.btn-warning {
    background: linear-gradient(135deg, #FF6B35 0%, #FF9500 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover,
.btn-warning:hover {
    background: linear-gradient(135deg, #FF6B35 0%, #FF9500 100%) !important;
    opacity: 0.9 !important;
}

/* Secondary buttons with elegant gray */
.btn-secondary,
.btn-outline-secondary {
    background: linear-gradient(90deg, #6c757d, #495057) !important;
    color: white !important;
    border: none !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: linear-gradient(90deg, #495057, #343a40) !important;
    color: white !important;
}

/* Success buttons with green gradient */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #17a2b8 100%) !important;
}

/* Danger buttons with red gradient */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #bd2130 0%, #a71e2a 100%) !important;
}

/* Large buttons - uniform across all devices */
.btn-lg {
    padding: 16px 32px !important;
    font-size: 1.1rem !important;
    min-height: 56px !important;
    border-radius: 10px !important;
}

/* Small buttons - uniform across all devices */
.btn-sm {
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    min-height: 40px !important;
    border-radius: 6px !important;
}

/* Icon spacing in buttons */
.btn i {
    margin-right: 8px !important;
}

.btn i:last-child {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* Disabled button state */
.btn:disabled {
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    cursor: not-allowed !important;
}

/* Button groups */
.btn-group .btn {
    margin: 0 !important;
    border-radius: 0 !important;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Special styling for form buttons */
.d-grid .btn {
    width: 100% !important;
}

/* Outline button variants */
.btn-outline-primary {
    background: transparent !important;
    color: #FF6B35 !important;
    border: 2px solid #FF6B35 !important;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #FF6B35 0%, #FF9500 100%) !important;
    color: white !important;
    border-color: transparent !important;
}

/* Card action buttons */
.card .btn {
    margin: 4px !important;
}

/* Loading state for buttons */
.btn.loading {
    color: transparent !important;
    position: relative !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Uniform button dimensions override previous settings */
.btn {
    font-size: 0.9rem !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    border-radius: 8px !important;
    letter-spacing: 0.2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
    line-height: 1.4 !important;
}

.btn-lg {
    font-size: 1rem !important;
    padding: 16px 24px !important;
    min-height: 52px !important;
    gap: 10px !important;
}

.btn-sm {
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
    min-height: 36px !important;
    gap: 6px !important;
}

/* Icon and text alignment inside buttons */
.btn i {
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    display: inline-block !important;
}

/* Ensure text is centered in all button variants */
.d-grid .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Force center alignment for all buttons regardless of context */
.btn, .btn:hover, .btn:focus, .btn:active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Override any inline styles that might affect alignment */
.btn[style*="padding"], .btn[style*="font-family"], .btn[style*="font-size"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Ultra-specific rules to override all button alignment issues */
button.btn, a.btn, input.btn, .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    gap: 8px !important;
}

/* Ensure uniform spacing between all buttons */
.d-grid.gap-3 > *, .d-grid.gap-2 > * {
    margin-bottom: 0 !important;
}

/* Force gap-1.5 spacing for all button groups */
.d-grid[class*="gap"] {
    gap: 0.75rem !important; /* Custom gap-1.5 = 12px */
}

/* Remove double spacing from icons */
.btn i + span, .btn i + text {
    margin-left: 0 !important;
}

/* Force proper icon-text spacing in all button types */
.btn i + * {
    margin-left: 0 !important;
}

/* Prevent text and icon misalignment */
.btn * {
    vertical-align: middle !important;
    line-height: 1 !important;
}

.btn-primary {
    background-color: #FF6B35;
    border-color: #FF6B35;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #FF9500;
    border-color: #FF9500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
    color: #FF6B35;
    border-color: #FF6B35;
}

.btn-outline-primary:hover {
    background-color: #FF6B35;
    border-color: #FF6B35;
    color: #ffffff;
}

/* Pulsanti success in verde per contrasto */
.btn-success {
    background-color: #43A047;
    border-color: #43A047;
}

.btn-success:hover {
    background-color: #388E3C;
    border-color: #388E3C;
}

/* Pulsanti secondari in grigio neutro */
.btn-secondary {
    background-color: #757575;
    border-color: #757575;
}

.btn-secondary:hover {
    background-color: #616161;
    border-color: #616161;
}

/* Pulsanti info con stile arancione chiaro */
.btn-outline-info {
    color: #FF6B35;
    border-color: #FF6B35;
}

.btn-outline-info:hover {
    background-color: #FF6B35;
    border-color: #FF6B35;
    color: #ffffff;
}

/* Pulsanti warning con stile arancione */
.btn-warning {
    background-color: #FF6B35;
    border-color: #FF6B35;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #FF9500;
    border-color: #FF9500;
    color: #ffffff;
}

.btn-warning:disabled {
    background-color: #FF6B35;
    border-color: #FF6B35;
    opacity: 0.65;
}

.text-primary {
    color: #FF6B35 !important;
}

/* Admin navbar elegant hover effects */
.navbar .nav-link[style*="rgba(255, 255, 255"]:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

/* Active page styling for admin nav */
.navbar .nav-link[style*="rgba(255, 255, 255, 0.2)"] {
    background: rgba(255, 255, 255, 0.25) !important;
    font-weight: 700 !important;
}

/* Audio Control Switch */
.audio-control-wrapper {
    position: relative;
}

.audio-checkbox {
    display: none;
}

.audio-toggle {
    position: relative;
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745, #1e7e34); /* Default green for ON */
    border: 3px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.audio-slider {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.audio-icon {
    color: white;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.audio-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.audio-checkbox:not(:checked) + .audio-toggle {
    background: linear-gradient(135deg, #dc3545, #c82333); /* Red when OFF */
}

.audio-checkbox:checked + .audio-toggle:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.audio-checkbox:not(:checked) + .audio-toggle:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.audio-checkbox:checked + .audio-toggle .audio-icon {
    transform: scale(1.1);
}

/* Camera & Audio Controls Panel */
.camera-controls-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

/* Control Button Base Style */
.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Camera Button */
.camera-btn {
    background: linear-gradient(135deg, #FF6B35, #FF9500);
}

.camera-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, #FF9500, #FF6B35);
}

.camera-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Audio Button */
.audio-btn {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.audio-btn.audio-enabled {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.audio-btn.audio-disabled {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.audio-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.audio-btn.audio-enabled:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.audio-btn.audio-disabled:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.audio-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .camera-controls-panel {
        top: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .control-btn,
    .audio-toggle {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

.mirror-icon {
    display: inline-block;
    transform: scaleX(-1);
}

.alert-success {
    background-color: rgba(52, 168, 83, 0.1);
    border-color: rgba(52, 168, 83, 0.2);
    color: #34A853;
}

.alert-success .alert-heading {
    color: #34A853;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
}

#videoCode, #videoPassword {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    color: #333;
    font-size: 1.2rem;
}

#resultContainer p {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

#resultContainer p.small {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0;
}

.recording-indicator {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.alert-info {
    background-color: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.2);
    color: #FF6B35;
}

.alert-info .alert-heading {
    color: #FF6B35;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}

.alert-danger {
    background-color: rgba(234, 67, 53, 0.1);
    border-color: rgba(234, 67, 53, 0.2);
    color: #EA4335;
}

.alert-danger .alert-heading {
    color: #EA4335;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}

.lead {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
}

/* Improved button proportions and spacing for video recording */
.btn-lg {
    min-height: 56px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 16px 24px !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
}

.btn-lg:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn-warning.btn-lg {
    background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
    border: none !important;
}

.btn-danger.btn-lg {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: none !important;
}

.btn-lg:disabled {
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

/* ========== RESPONSIVE DESIGN FOR ALL MOBILE DEVICES ========== */

/* ZFold5 Inner Screen and Large Tablets - 1200px to 1900px */
@media screen and (min-width: 1200px) and (max-width: 1900px) {
    .container {
        max-width: 1400px;
        padding: 0 20px;
    }
    
    .col-md-8 {
        max-width: 80%;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .app-logo {
        height: 70px;
    }
    
    .video-container {
        max-width: 720px;
    }
    
    .btn {
        padding: 14px 24px !important;
        font-size: 1.1rem !important;
    }
    
    .card-body {
        padding: 2rem;
    }
}

/* Tablet Landscape - 768px to 1199px */
@media screen and (min-width: 768px) and (max-width: 1199px) {
    .container {
        padding: 0 15px;
    }
    
    .app-title {
        font-size: 1.6rem;
    }
    
    .app-logo {
        height: 55px;
    }
    
    .video-container {
        max-width: 600px;
    }
    
    .btn {
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    /* My Videos responsive grid */
    .video-item {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
}

/* Mobile Portrait and Small Tablets - up to 767px */
@media screen and (max-width: 767px) {
    .container {
        padding: 0 10px !important;
    }
    
    .py-4 {
        padding-top: 2rem !important;
        padding-bottom: 1rem !important;
    }
    
    .app-title {
        font-size: 1.4rem !important;
        /* Mantieni layout orizzontale */
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }
    
    .app-logo {
        height: 45px !important;
        margin: 0 10px !important;
    }
    
    .app-title i {
        margin: 0 8px !important;
        font-size: 1.2rem !important;
    }
    
    .video-container {
        max-width: 100% !important;
        border-radius: 8px !important;
    }
    
    .btn {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-header {
        padding: 0.75rem 1rem !important;
    }
    
    .card-header h4 {
        font-size: 1.2rem !important;
    }
    
    /* My Videos mobile grid */
    .video-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    /* Responsive text sizes */
    h1, h2, h3 {
        font-size: 1.5rem !important;
    }
    
    h4, h5 {
        font-size: 1.2rem !important;
    }
    
    h6 {
        font-size: 1rem !important;
    }
    
    .text-muted {
        font-size: 0.85rem !important;
    }
    
    /* Form controls */
    .form-control, .form-select {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }
    
    .form-control-sm, .form-select-sm {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }
    
    /* Navigation adjustments */
    .badge {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    
    /* Controls layout adjustments */
    .d-flex.gap-3 {
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-2 {
        gap: 0.5rem !important;
    }
    
    /* Camera controls mobile adjustment */
    .camera-controls-panel {
        top: 10px !important;
        right: 10px !important;
        gap: 10px !important;
    }
    
    .control-btn,
    .audio-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
}

/* Extra Small Devices - up to 575px */
@media screen and (max-width: 575px) {
    .container {
        padding: 0 8px !important;
    }
    
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .app-title {
        font-size: 1.2rem !important;
        /* Mantieni layout orizzontale anche su mobile */
        flex-direction: row !important;
        gap: 0 !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .app-logo {
        height: 35px !important;
        margin: 0 8px !important;
    }
    
    .app-title i {
        margin: 0 6px !important;
        font-size: 1rem !important;
    }
    
    .btn {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        min-height: 40px !important;
    }
    
    .card {
        margin-bottom: 1rem !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* My Videos single column on very small screens */
    .video-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Stack controls vertically on very small screens */
    .row .col-md-6 .d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .justify-content-md-end {
        justify-content: flex-start !important;
    }
    
    /* Video info adjustments */
    .video-info-banner {
        padding: 8px !important;
        font-size: 0.8rem !important;
    }
    
    /* Description card adjustments */
    .description-content {
        text-align: left !important;
    }
    
    .description-content h6 {
        font-size: 1rem !important;
    }
    
    .description-content p {
        font-size: 0.8rem !important;
    }
    
    /* Small controls for very small screens */
    .control-btn,
    .audio-toggle {
        width: 35px !important;
        height: 35px !important;
        font-size: 12px !important;
    }
    
    /* Language and admin badges smaller */
    .badge {
        padding: 2px 6px !important;
        font-size: 0.7rem !important;
    }
    
    /* Language toggle adjustments */
    .d-flex.gap-2 .badge {
        min-width: 25px !important;
        text-align: center !important;
    }
}