/* CB Radio SA - Custom Styles */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Global Styles */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    padding-top: 76px; /* Account for fixed navbar */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

* {
    box-sizing: border-box;
}

/* Prevent horizontal overflow on all elements */
/* .container,
.container-fluid,
.row {
    max-width: 100%;
} */

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

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

.navbar-nav .dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    position: relative;
    overflow: hidden;
    margin-top: -12px;
    padding-top: calc(76px + 3rem);
}

.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="radio-waves" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23radio-waves)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-image {
    position: relative;
    z-index: 2;
}

.hero-section .badge {
    animation: pulse 2s infinite;
}

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

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(45deg, #f8f9fa 0%, #e9ecef 100%);
}

.newsletter-form {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#newsletter-message.alert {
    max-width: 500px;
    margin: 0 auto;
}

/* Quick Access Cards */
.quick-access .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.quick-access .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

.quick-access .card i {
    transition: color 0.3s ease;
}

.quick-access .card:hover i {
    transform: scale(1.1);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #343a40 100%);
}

footer h5, footer h6 {
    color: var(--warning-color);
}

footer a {
    color: #f8f9fa !important;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warning-color) !important;
    transition: color 0.3s ease;
}

/* Improve footer text contrast */
footer .text-light {
    color: #f8f9fa !important;
}

footer .opacity-75 {
    opacity: 0.75 !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Fix body padding for mobile navigation */
    body {
        padding-top: 66px;
    }
    
    /* Hero Section Mobile */
    .hero-section {
        margin-top: -12px;
        padding-top: calc(66px + 2rem);
        padding-bottom: 2rem;
    }
    
    .hero-section .display-4 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    /* Fix hero content spacing */
    .hero-content .mb-4 {
        margin-bottom: 2rem !important;
    }
    
    /* Improve hero benefits layout on mobile */
    .hero-content .row .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Fix CTA buttons */
    .hero-content .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-content .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Fix hero image section */
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-image .display-1 {
        font-size: 4rem;
    }
    
    /* Fix quick access cards */
    .quick-access .card {
        margin-bottom: 1rem;
    }
    
    /* Fix newsletter form for mobile */
    .newsletter-form .row {
        flex-direction: column;
    }
    
    .newsletter-form .col-md-6,
    .newsletter-form .col-md-3 {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    /* Improve section padding on mobile */
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Fix container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Fix badge overflow on mobile */
    .badge {
        word-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
        text-align: center;
        max-width: 100%;
        display: inline-block;
    }
    
    /* Ensure badges don't overflow container */
    .badge.fs-5 {
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* Fix navbar brand size */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    /* Fix footer layout */
    footer .row {
        text-align: center;
    }
    
    footer .col-md-3,
    footer .col-md-6 {
        margin-bottom: 1.5rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    /* Further reduce hero title size */
    .hero-section .display-4 {
        font-size: 1.75rem !important;
    }
    
    /* Adjust hero section for extra small devices */
    .hero-section {
        padding-top: calc(66px + 1.5rem);
        padding-bottom: 1.5rem;
    }
    
    /* Reduce card padding */
    .card-body {
        padding: 1rem;
    }
    
    /* Further improve badge responsiveness on very small screens */
    .badge.fs-5 {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
        line-height: 1.2;
    }
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !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: #ffffff;
    border-radius: 50%;
    animation: spin 1s ease infinite;
}

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

/* Utility Classes */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

.border-warning-subtle {
    border-color: rgba(255, 193, 7, 0.3) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--warning-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .newsletter-section,
    footer {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto !important;
    }
    
    .hero-section * {
        color: black !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero-section {
        background: #000080 !important;
    }
    
    .card {
        border: 2px solid #000 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
