/* Base styles */
:root {
    --primary-bg: #0A0E1A;
    --secondary-bg: #151D35;
    --nav-item-bg: #111530;
    --accent-blue: #3498db;
    --accent-yellow: #f1c40f;
    --accent-pink: #e84393;
    --accent-purple: #9b59b6;
    --accent-orange: #f39c12;
    --accent-green: #2ecc71;
    --button-blue: #3498db;
    --dark-blue: #1e3a73;
    --light-text: #ecf0f1;
    --medium-text: #bdc3c7;
    --dark-text: #2c3e50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden; /* Prevent horizontal overflow at the root level */
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--primary-bg);
    color: #ffffff;
    line-height: 1.6;
    margin: 0; /* Ensure no margin constrains the footer */
    overflow-x: visible; /* Allow footer to stretch */
    padding-bottom: 85px; /* Prevent content from being hidden under fixed footer (50px footer + 35px copyright) */
}

body.modal-open {
    overflow: hidden; /* Prevent scrolling when modal is open */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure Font Awesome icons render correctly across the site */
i.fab, i.fas {
    font-family: 'Font Awesome 5 Brands', 'Font Awesome 5 Free' !important;
    display: inline-block !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    visibility: visible !important; /* Ensure icons are not hidden */
    width: auto !important; /* Prevent width issues */
    height: auto !important; /* Prevent height issues */
}

/* Navigation-specific icons */
.nav-icon i {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    color: inherit !important; /* Inherit color from parent */
}

/* Mobile header and nav toggle/close icons */
.mobile-header-logo i,
.mobile-nav-toggle i,
.mobile-nav-close i {
    display: inline-block !important;
    font-size: inherit !important;
    color: inherit !important;
}

/* Social media icons in footer */
.social-icons a i {
    display: inline-block !important;
    font-size: 14px !important;
    color: #fff !important;
}

/* Layout Structure */
.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    margin-bottom: 30px;
}

/* Navigation Styles */
.side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-nav .logo-container {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.side-nav .main-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.nav-item {
    background-color: var(--nav-item-bg);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
    background-color: var(--dark-blue);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
    border-left: 4px solid var(--accent-blue);
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #ffffff;
}

.nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    display: flex;
    flex-direction: column;
}

/* Icon Colors */
.home-icon {
    background-color: var(--accent-green);
    color: #fff !important;
}

.events-icon {
    background-color: var(--accent-yellow);
    color: #000 !important;
}

.schedule-icon {
    background-color: var(--accent-pink);
    color: #fff !important;
}

.on-air-icon {
    background-color: var(--accent-pink);
    color: #fff !important;
}

.podcasts-icon {
    background-color: var(--accent-purple);
    color: #fff !important;
}

.show-icon {
    background-color: var(--accent-orange);
    color: #fff !important;
}

.about-icon {
    background-color: var(--accent-orange);
    color: #fff !important;
}

.donate-icon {
    background-color: var(--accent-pink);
    color: #fff !important;
}

.programs-icon {
    background-color: var(--accent-green);
    color: #fff !important;
}

.chat-icon {
    background-color: var(--accent-blue);
    color: #fff !important;
}

.social-icon {
    background-color: var(--accent-blue);
    color: #fff !important;
}

/* Main Content Area */
.main-content {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.icon-header {
    display: flex;
    align-items: center;
}

.header-icon {
    width: 40px;
    height: 40px;
    background-color: var(--accent-yellow);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
    color: #000;
}

h1 {
    font-size: 1.8rem;
    color: var(--accent-blue);
}

/* Common Right Sidebar Styles */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-section,
.tune-in-section {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 20px;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2c3e50;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.login-button {
    width: 100%;
    padding: 10px;
    background-color: var(--button-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background-color: #2980b9;
}

.login-button:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Stream Player Styles */
.stream-player {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.stream-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.stream-btn {
    flex-grow: 1;
    text-align: center;
    padding: 8px 0;
    background-color: var(--dark-blue);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.stream-btn:hover,
.stream-btn.active {
    background-color: var(--accent-blue);
}

.stream-btn:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.play-btn:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    width: 100px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 5px;
    background-color: #34495e;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    cursor: pointer;
    border: none;
}

.now-playing {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 5px;
}

.now-playing p {
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--medium-text);
}

/* Common Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 25px;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.close-modal:hover {
    background: rgba(231, 76, 60, 0.8);
}

.close-modal i {
    font-size: 16px;
}

.modal-header {
    padding: 0 0 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.modal-body {
    padding: 0;
}

.modal-footer {
    padding: 20px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Animation Effects */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Error Messages */
.error-message {
    background-color: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.error-message h2 {
    color: #e74c3c;
    margin-bottom: 10px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 85px; /* Above the fixed footer (50px footer + 35px copyright) */
    left: 0;
    width: 100vw;
    background-color: var(--secondary-bg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.cookie-banner p {
    flex-grow: 1;
    margin-right: 20px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-buttons button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#accept-cookies {
    background-color: var(--accent-green);
    color: white;
}

#decline-cookies {
    background-color: var(--dark-blue);
    color: white;
}

/* Footer Styles - FIXED FULL-WIDTH TASKBAR FOR ALL SCREEN SIZES */
.site-footer {
    background-color: #0d1326;
    width: 100vw;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.footer-content {
    display: flex;
    flex-wrap: nowrap; /* Never wrap on desktop */
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 15px;
    gap: 15px;
    height: 50px;
}

.footer-logo {
    flex: 0 0 auto;
    min-width: 80px;
    display: flex;
    align-items: center;
}

.footer-logo img {
    max-width: 60px;
    height: auto;
}

.footer-links {
    flex: 1 1 200px;
    min-width: 120px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.quick-links-btn {
    background-color: var(--dark-blue);
    color: var(--light-text);
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.quick-links-btn:hover {
    background-color: var(--accent-blue);
}

.quick-links-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 8px 0;
    z-index: 1001;
    width: 180px;
    margin-bottom: 10px;
}

.quick-links-menu a {
    color: var(--light-text);
    text-decoration: none;
    padding: 8px 15px;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: left;
}

.quick-links-menu a:hover {
    background-color: var(--dark-blue);
    color: var(--accent-blue);
}

.footer-social {
    flex: 1 1 200px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-social h4 {
    color: var(--accent-blue);
    margin-bottom: 3px;
    font-size: 0.9rem;
    text-align: center;
}

.social-icons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--dark-blue);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 12px;
}

.social-icon-twitter:hover {
    background-color: #1da1f2;
}

.social-icon-facebook:hover {
    background-color: #3b5998;
}

.social-icon-instagram:hover {
    background-color: #e1306c;
}

.social-icon-discord:hover {
    background-color: #7289da;
}

.copyright {
    color: var(--medium-text);
    font-size: 0.75rem;
    text-align: center;
    flex: 0 0 auto;
}

/* Only apply mobile footer styles on very small screens */
@media (max-width: 576px) {
    body {
        padding-bottom: 130px;
    }

    .site-footer {
        padding: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px 15px;
        height: auto;
        flex-wrap: wrap;
    }

    .footer-logo,
    .footer-links,
    .footer-social {
        flex: none;
        min-width: auto;
        width: 100%;
        align-items: center;
    }

    .quick-links-menu {
        position: static;
        transform: none;
        margin-top: 8px;
        width: 100%;
    }

    .copyright {
        margin-top: 8px;
    }
}

.desktop-only {
    display: block;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 200px 1fr 250px;
    }

    .footer-content {
        gap: 10px;
    }
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 180px 1fr;
    }

    .right-sidebar {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .footer-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        height: auto;
        padding: 15px;
    }

    .footer-logo,
    .footer-links,
    .footer-social {
        flex: 1 1 45%;
        min-width: 200px;
        align-items: center;
    }

    .footer-links {
        align-items: center;
    }

    .quick-links-menu {
        position: static;
        transform: none;
        margin-top: 8px;
        width: 100%;
    }

    .footer-social {
        align-items: center;
    }

    .copyright {
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 130px;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .side-nav,
    .main-content,
    .right-sidebar {
        grid-column: 1;
    }

    .side-nav {
        grid-row: 2;
    }

    .main-content {
        grid-row: 1;
    }

    .right-sidebar {
        grid-row: 3;
    }

    .cookie-banner {
        bottom: 130px;
    }

    .site-footer {
        padding: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px 15px;
        height: auto;
    }

    .footer-logo,
    .footer-links,
    .footer-social {
        flex: none;
        min-width: auto;
        width: 100%;
        align-items: center;
    }

    .desktop-only {
        display: none;
    }
}

@media (max-width: 576px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .modal-content {
        width: 95%;
    }

    .social-icons {
        justify-content: center;
    }
}

/* Mobile Header Nav Bar (Visible only on mobile) */
.mobile-header-nav {
    display: none;
}

/* Mobile Navigation Styles */
.mobile-nav-toggle {
    display: none;
    z-index: 1001;
}

.mobile-nav-toggle button {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 12px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
}

.mobile-nav-toggle button:hover {
    background-color: var(--dark-blue);
}

/* Mobile Navigation Close Button (Visible only on mobile) */
.mobile-nav-close {
    display: none;
}

/* Mobile Menu Responsiveness */
@media (max-width: 992px) {
    body {
        overflow-x: hidden;
    }

    .mobile-header-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: var(--primary-bg);
        padding: 10px 15px;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .mobile-header-logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-header-logo i {
        font-size: 1.5rem;
        color: var(--accent-blue);
    }

    .logo-japan {
        color: var(--accent-blue);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .logo-hyphen {
        color: var(--light-text);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .logo-a {
        color: var(--accent-pink);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .logo-radio {
        color: var(--accent-green);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .mobile-nav-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.3);
        border: none;
        color: var(--light-text);
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s;
        font-size: 1.5rem;
    }

    .mobile-nav-close:hover {
        background: rgba(231, 76, 60, 0.8);
    }

    .side-nav {
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        width: 250px;
        height: 100vh;
        background-color: var(--primary-bg);
        z-index: 1001;
        overflow-y: auto;
        overflow-x: hidden;
        transition: transform 0.3s ease;
        box-shadow: none;
        padding-top: 60px;
        padding-bottom: 20px;
        gap: 15px;
        margin-left: -5px;
    }

    .side-nav.active {
        transform: translateX(0);
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        margin-left: 0;
    }

    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .menu-overlay.active {
        display: block;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
        padding-top: 60px;
    }

    .main-content {
        grid-column: 1;
        grid-row: 1;
    }

    .right-sidebar {
        grid-column: 1;
        grid-row: 2;
        margin-top: 20px;
    }

    .logo-container {
        padding: 15px;
    }

    .main-logo {
        max-width: 150px;
        height: auto;
    }

    .nav-item {
        margin: 0 10px;
        min-height: 48px;
        overflow: visible;
    }

    .nav-item a {
        padding: 8px 12px;
        min-height: 48px;
        align-items: center;
    }

    .nav-icon {
        width: 36px;
        height: 36px;
        margin-right: 10px;
        font-size: 18px;
        flex-shrink: 0;
    }

    .nav-text {
        font-size: 0.95rem;
        line-height: 1.2;
        flex: 1;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .side-nav {
        width: 100%;
        transform: translateX(-100%);
        padding-bottom: 30px;
        gap: 12px;
    }

    .side-nav.active {
        transform: translateX(0);
    }

    .main-logo {
        max-width: 120px;
    }

    .nav-item {
        margin: 0 8px;
        min-height: 44px;
    }

    .nav-item a {
        padding: 6px 10px;
        min-height: 44px;
    }

    .nav-icon {
        width: 32px;
        height: 32px;
        margin-right: 8px;
        font-size: 16px;
    }

    .nav-text {
        font-size: 0.9rem;
    }

    .mobile-header-logo i {
        font-size: 1.3rem;
    }

    .logo-japan,
    .logo-a,
    .logo-radio,
    .logo-hyphen {
        font-size: 1.1rem;
    }
}