/* Estilos comunes para aplicaciones de radio amateur */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    padding: 10px;
    min-height: 100vh;
    /* Optimizaciones de rendimiento móvil */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Menú hamburguesa */
.hamburger-menu {
    position: relative;
    margin-bottom: 20px;
}

.menu-bar {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-height: 45px;
    /* Mejora táctil móvil */
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.1);
    touch-action: manipulation;
}

.menu-bar:hover {
    background: #222;
    border-color: #4CAF50;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-right: 12px;
}

.hamburger-icon span {
    width: 18px;
    height: 2px;
    background: #ccc;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.menu-bar:hover .hamburger-icon span {
    background: #4CAF50;
}

.current-page {
    flex: 1;
    font-size: 14px;
    color: #4CAF50;
    font-weight: 500;
}

.menu-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 5px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: #ccc;
    transition: all 0.3s ease;
    border-bottom: 1px solid #333;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #2a2a2a;
    color: #4CAF50;
    text-decoration: none;
}

.menu-item.active {
    background: #2a2a2a;
    color: #4CAF50;
    border-left: 3px solid #4CAF50;
}

.menu-icon {
    font-size: 16px;
    min-width: 20px;
}

.menu-text {
    font-size: 13px;
    font-weight: 500;
}

.container {
    max-width: 400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 5px;
}

.update-time {
    font-size: 12px;
    color: #888;
}

.main-indicators {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.secondary-indicators {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.indicator-card {
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    /* Optimización de rendimiento */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    contain: layout style paint;
}

.indicator-card:hover,
.indicator-card:active {
    border-color: var(--indicator-color);
    background: #222;
}

.indicator-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 10px;
}

.indicator-icon-left {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.indicator-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.indicator-label {
    font-size: 13px;
    color: #888;
    min-width: 60px;
    flex-shrink: 0;
}

.indicator-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--indicator-color);
}

.indicator-status {
    font-size: 12px;
    color: var(--indicator-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.indicator-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--indicator-color);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--indicator-color);
}

.indicator-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.indicator-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid transparent;
}

.indicator-card.expanded .indicator-details {
    max-height: 200px;
    border-top-color: #333;
}

.indicator-details-content {
    padding: 15px;
    background: #151515;
}

.indicator-description {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
    line-height: 1.4;
}

.indicator-scale {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-bottom: 8px;
}

.indicator-extended {
    font-size: 10px;
    color: #777;
    line-height: 1.4;
    padding-top: 8px;
    border-top: 1px solid #222;
}

.expand-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.indicator-card.expanded .expand-arrow {
    transform: rotate(180deg);
}

.bands-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.bands-section:hover {
    border-color: #4CAF50;
    background: #222;
}

.bands-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bands-title {
    font-size: 14px;
    color: #4CAF50;
    font-weight: 500;
    margin: 0;
}

.bands-expand-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.bands-section.expanded .bands-expand-arrow {
    transform: rotate(180deg);
}

.bands-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid transparent;
}

.bands-section.expanded .bands-content {
    max-height: 500px;
    border-top-color: #333;
}

/* Estilos para sección de bandas fija (no desplegable) */
.bands-section-fixed {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 20px;
    overflow: visible;
}

.bands-recommendation {
    padding: 15px;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-bottom: 2px solid #333;
    font-size: 14px;
    font-weight: 600;
    color: #ffd700;
    text-align: center;
    line-height: 1.5;
}

.bands-header-fixed {
    padding: 15px;
    border-bottom: 1px solid #333;
}

.bands-content-fixed {
    display: block;
}

.band-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.band-item {
    background: #252525;
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid var(--band-color);
    transition: background 0.2s;
}

.band-item:hover {
    background: #2a2a2a;
}

.band-name {
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    min-width: 80px;
}

.band-status {
    font-size: 13px;
    color: var(--band-color);
    font-weight: 600;
    text-transform: uppercase;
}

.band-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--band-color);
}

/* Estilos para bandas detalladas con estrellas */
.band-item-detailed {
    background: #252525;
    border-radius: 6px;
    padding: 10px 15px;
    border-left: 3px solid var(--band-color);
    transition: background 0.2s;
    position: relative;
    /* Optimización de rendering */
    will-change: background;
    contain: layout style;
}

.band-item-detailed:hover {
    background: #2a2a2a;
}

.band-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.band-stars {
    display: flex;
    gap: 1px;
    align-items: center;
}

.star {
    font-size: 12px;
    opacity: 0.25;
    filter: grayscale(100%);
}

.star.filled {
    opacity: 1;
    filter: grayscale(0%);
}

.band-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 4px;
    margin-left: auto;
    /* Mejora táctil móvil */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.1);
    touch-action: manipulation;
}

.info-btn:hover,
.info-btn:active {
    color: #4CAF50;
    transform: scale(1.15);
}

.band-explanation {
    display: none;
    margin-top: 8px;
    padding: 10px;
    background: rgba(26, 26, 26, 0.95);
    border-left: 2px solid var(--band-color);
    border-radius: 4px;
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
    /* Optimización de animación */
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.band-explanation.show {
    display: block;
    max-height: 200px;
    opacity: 1;
}

.recommendation {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    text-align: center;
    font-size: 16px;
    margin-bottom: 20px;
}

.refresh-btn, .calculate-btn {
    display: block;
    width: 100%;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.refresh-btn:hover, .calculate-btn:hover {
    background: #45a049;
}

.refresh-btn:active, .calculate-btn:active {
    transform: scale(0.98);
}

.error {
    background: #f44336;
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Estilos específicos para formularios */
.form-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    margin-bottom: 20px;
}

.form-title {
    font-size: 16px;
    color: #4CAF50;
    margin-bottom: 15px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-input::placeholder {
    color: #666;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-item:hover {
    background: #333;
    border-color: #4CAF50;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    accent-color: #4CAF50;
}

.checkbox-item label {
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    margin: 0;
}

/* Estilos para mapas y visualización */
.map-container {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 20px;
    overflow: hidden;
}

.map-header {
    padding: 15px;
    border-bottom: 1px solid #333;
    background: #151515;
}

.map-content {
    padding: 20px;
    text-align: center;
}

.propagation-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.results-grid {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.result-band {
    background: #252525;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--band-color);
}

.result-band-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--band-color);
    margin-bottom: 8px;
}

.result-description {
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
}

/* Optimizaciones específicas para móvil */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
        padding: 0 5px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }

    /* Reducir animaciones en móvil para mejor rendimiento */
    .band-item-detailed,
    .indicator-card {
        transition: none;
    }

    /* Optimizar fuentes en móvil */
    body {
        font-size: 14px;
    }

    /* Mejorar área táctil de botones */
    .info-btn {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Prefiere movimiento reducido (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estilos específicos para index.php */
.welcome-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #333;
    margin-bottom: 20px;
    text-align: center;
}

.welcome-title {
    font-size: 28px;
    color: #4CAF50;
    margin-bottom: 15px;
    font-weight: 600;
}

.welcome-subtitle {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.4;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: #252525;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #333;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    background: #2a2a2a;
    border-color: #4CAF50;
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 18px;
    color: #4CAF50;
    margin-bottom: 8px;
    font-weight: 500;
}

.feature-description {
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
}

.info-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    margin-bottom: 20px;
}

.info-title {
    font-size: 16px;
    color: #4CAF50;
    margin-bottom: 12px;
    font-weight: 500;
}

.info-text {
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 10px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
}

.link-item {
    color: #66bb6a;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.link-item:hover {
    color: #81c784;
    text-decoration: none;
}

.links-section {
    margin: 20px 0;
    padding: 0;
}

.links-title {
    font-size: 18px;
    color: #4CAF50;
    margin-bottom: 15px;
    font-weight: 500;
}

.disclaimer {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
    margin: 30px 0 10px 0;
    padding: 15px;
    border-left: 3px solid #333;
    background: rgba(255, 255, 255, 0.02);
}

/* Botón para abrir modal de links */
.links-button {
    width: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #4CAF50;
    border-radius: 12px;
    padding: 15px 20px;
    color: #4CAF50;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.1);
    touch-action: manipulation;
}

.links-button:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
    border-color: #66bb6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.links-button:active {
    transform: translateY(0);
}

/* Modal de links */
.links-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.links-modal-content {
    background: #0a0a0a;
    border: 2px solid #4CAF50;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.links-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 14px 14px 0 0;
}

.links-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #4CAF50;
}

.links-modal-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.links-modal-close:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    transform: rotate(90deg);
}

.links-modal-body {
    padding: 20px 25px;
}

.links-section-group {
    margin-bottom: 25px;
}

.links-section-group:last-child {
    margin-bottom: 0;
}

.links-section-title {
    font-size: 16px;
    color: #4CAF50;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 15px;
    text-decoration: none;
    color: #ccc;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.1);
}

.link-card:hover {
    background: #252525;
    border-color: #4CAF50;
    transform: translateX(4px);
    color: #4CAF50;
}

.link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.link-text {
    font-size: 13px;
    font-weight: 500;
}

/* Scroll personalizado para el modal */
.links-modal-content::-webkit-scrollbar {
    width: 8px;
}

.links-modal-content::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 0 16px 16px 0;
}

.links-modal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.links-modal-content::-webkit-scrollbar-thumb:hover {
    background: #4CAF50;
}

/* Responsive para modal */
@media (max-width: 480px) {
    .links-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .links-modal-header {
        padding: 15px 20px;
    }

    .links-modal-body {
        padding: 15px 20px;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}