/* ==========================================
   W2JKT Communications Station - Shared Styles
   ========================================== */

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

:root {
    --primary-color: #1a5490;
    --secondary-color: #2c7cc1;
    --accent-color: #ff6b35;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --bg-light: #f8f9fa;
    --bg-dark: #1e1e1e;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

body.subpage {
    background: var(--bg-light);
}

/* ==========================================
   Header & Navigation
   ========================================== */

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--text-light);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Nav Indicator Container (BMS + Internet status) */

.nav-indicators {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: 1rem;
    margin-right: auto;
}

/* Nav BMS Status Indicators */

.nav-bms {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.nav-bms-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    line-height: 1;
}

.nav-bms-arrow {
    font-size: 0.5rem;
    width: 0.5rem;
    text-align: center;
    margin-right: -0.3rem;
}

.nav-bms-arrow-up {
    color: #2ecc71;
}

.nav-bms-arrow-down {
    color: #e74c3c;
}

.nav-bms-mac {
    color: rgba(255,255,255,0.7);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 2.2rem;
    text-align: right;
}

.nav-bms-bar {
    display: inline-block;
    width: 36px;
    height: 7px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.nav-bms-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
}

/* Nav Internet Status Indicators */

.nav-status {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.nav-status-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.nav-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e74c3c;
}

.nav-status-dot.up {
    background: #2ecc71;
}

.nav-status-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Hamburger Menu */

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ==========================================
   Hero Section
   ========================================== */

.hero {
    background: linear-gradient(135deg, var(--bg-dark), var(--primary-color));
    color: var(--text-light);
    padding: 120px 2rem 80px;
    text-align: center;
    margin-top: 60px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

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

/* ==========================================
   Section Styles (index.html)
   ========================================== */

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 2rem;
}

#contact {
    padding: 60px 2rem;
}

section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* About Section */

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

.mission-box {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 5px solid var(--accent-color);
    border-right: 5px solid var(--accent-color);
}

.mission-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* ==========================================
   Equipment Section
   ========================================== */

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.equipment-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.equipment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.equipment-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.equipment-card ul {
    list-style: none;
    padding-left: 0;
}

.equipment-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.equipment-card li:last-child {
    border-bottom: none;
}

.equipment-card li::before {
    content: '\25b8 ';
    color: var(--accent-color);
    font-weight: bold;
}

.equipment-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.image-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    padding: 1rem;
}

.carousel-image.active {
    opacity: 1;
}

.equipment-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.equipment-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.equipment-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.equipment-item p {
    color: #666;
    font-size: 0.9rem;
}

.power-info {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    text-align: center;
}

.power-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.remote-info {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    text-align: center;
}

.remote-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Terminal Display */

.terminal-display {
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 15px;
    overflow: hidden;
    text-align: left;
    line-height: 1.4;
}

.terminal-prompt {
    color: #00ff00;
}

.terminal-output {
    color: #ffffff;
}

/* ==========================================
   Services Section
   ========================================== */

#services {
    background: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    align-items: stretch;
}

.services-grid > a {
    display: flex;
    flex-direction: column;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card .frequency {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ==========================================
   Contact Section
   ========================================== */

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.form-note {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

/* ==========================================
   Digital Software Page
   ========================================== */

.software-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 2rem;
}

.software-card {
    display: flex;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.software-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.software-image-container {
    flex: 0 0 400px;
    min-height: 280px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.software-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.software-image-container .terminal-display {
    font-size: 12px;
    padding: 20px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.software-details {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.software-details h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.software-details .band-tag {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.software-details ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.software-details li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.software-details li::before {
    content: '\25b8';
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.software-link {
    display: inline-block;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.software-link:hover {
    color: var(--accent-color);
}

/* VARA Placeholder */

.vara-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a5490, #2c7cc1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem;
    text-align: center;
}

.vara-placeholder .vara-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.vara-placeholder .vara-title {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.vara-placeholder .vara-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.3rem;
}

/* ==========================================
   Portable Operations Page
   ========================================== */

.portable-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 2rem;
}

.portable-card {
    display: flex;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.portable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.portable-image-container {
    flex: 0 0 400px;
    min-height: 280px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.portable-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.portable-details {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portable-details h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.portable-details .role-tag {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.portable-details ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.portable-details li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.portable-details li::before {
    content: '\25b8';
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.portable-link {
    display: inline-block;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.portable-link:hover {
    color: var(--accent-color);
}

/* Power Highlight Box */

.power-highlight {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 2.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.power-highlight h3 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.power-highlight p {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.power-highlight p:last-child {
    margin-top: 1rem;
    opacity: 0.9;
}

/* ==========================================
   BMS Status Page
   ========================================== */

.bms-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 2rem;
}

.bms-status-message {
    text-align: center;
    font-size: 1.2rem;
    color: #888;
    padding: 2rem;
}

.bms-table-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bms-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.bms-table {
    border-collapse: collapse;
    white-space: nowrap;
}

.bms-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
}

.bms-table th {
    padding: 1rem 2.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.bms-table td {
    padding: 1rem 2.5rem;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
}

.bms-table tbody tr:last-child td {
    border-bottom: none;
}

.bms-table tbody tr:hover {
    background: #f0f6ff;
}

.bms-totals-row td {
    border-top: 2px solid var(--primary-color);
    border-bottom: none !important;
    font-weight: 600;
}

.bms-soc-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bms-soc-bar {
    width: 90px;
    height: 16px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}

.bms-soc-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s;
}

.bms-soc-pct {
    font-weight: 700;
    font-size: 0.95rem;
}

.bms-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.bms-badge-idle {
    background: #eee;
    color: #666;
}

.bms-badge-charge {
    background: #d4edda;
    color: #155724;
}

.bms-badge-discharge {
    background: #fff3cd;
    color: #856404;
}

.bms-badge-sleep {
    background: #d6d8db;
    color: #495057;
}

.bms-badge-offline {
    background: #d6d8db;
    color: #495057;
}

.bms-badge-fault {
    background: #f8d7da;
    color: #721c24;
    animation: bms-fault-pulse 2s ease-in-out infinite;
}

.bms-badge-warn {
    background: #fff3cd;
    color: #856404;
}

@keyframes bms-fault-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bms-ts {
    color: #888;
    font-size: 0.85rem;
}

/* Ryobi inverter section */
.ryobi-section-title {
    text-align: center;
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    color: #333;
}

.ryobi-bats-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ryobi-bat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ryobi-bat-name {
    font-size: 0.7rem;
    color: #666;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.ryobi-bat-segs {
    display: flex;
    gap: 2px;
}

.ryobi-seg {
    width: 12px;
    height: 10px;
    background: #e0e0e0;
    border-radius: 2px;
}

.ryobi-seg-on {
    transition: background 0.5s;
}

.ryobi-seg-absent {
    background: #f5f5f5;
    border: 1px dashed #ddd;
}

/* 818: 2-column battery grid */
.ryobi-bats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}


.ryobi-model-cell {
    text-align: center;
    vertical-align: middle;
}

.ryobi-model-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
}

.ryobi-card-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 3px;
}

.ryobi-1000-bat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.ryobi-1000-detail {
    font-size: 0.8em;
    color: #aaa;
    white-space: nowrap;
}

/* Mobile BMS cards (hidden on desktop) */
.bms-cards {
    display: none;
}

/* BMS detail page charts */
.bms-detail-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.bms-charts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bms-chart-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 1rem 1.2rem;
}

.bms-chart-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.bms-chart-box canvas {
    width: 100% !important;
    height: 200px !important;
}

.bms-card-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.bms-card-table td,
.bms-card-table th {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.bms-card-header {
    background: var(--bg-dark, #2c3e50);
    color: #fff;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 12px;
}

.bms-card-label {
    width: 33%;
    font-weight: 600;
    color: #666;
}

.bms-card-footer {
    text-align: center;
    padding: 10px 12px;
    border-bottom: none;
}

.bms-updated {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 1.5rem;
}

/* ==========================================
   Footer
   ========================================== */

footer {
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .nav-indicators {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        padding: 0.5rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .software-card {
        flex-direction: column;
    }

    .software-image-container {
        flex: 0 0 auto;
        min-height: 200px;
    }

    .portable-card {
        flex-direction: column;
    }

    .portable-image-container {
        flex: 0 0 auto;
        min-height: 200px;
    }

    .bms-soc-bar {
        width: 60px;
    }

    .bms-table-container {
        display: none;
    }

    .bms-totals-row {
        display: none;
    }

    .bms-cards {
        display: block;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}
