/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand h2 {
    color: white;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
}

.last-update {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card.large {
    grid-column: span 2;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stat-badge {
    background: #ecf0f1;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #7f8c8d;
    font-weight: 600;
}

/* Dashboard Content */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Map Styles */
.map-card, .map-full-card {
    height: 400px;
    display: flex;
    flex-direction: column;
}

#dashboard-map, #gps-map {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
}

.map-coordinates {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-family: monospace;
}

/* Status Cards */
.status-card {
    height: fit-content;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-label {
    font-weight: 500;
    color: #2c3e50;
}

.status-value {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-value.online {
    background: #d4edda;
    color: #155724;
}

.status-value.offline {
    background: #f8d7da;
    color: #721c24;
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric label {
    font-weight: 500;
    color: #5a6c7d;
    font-size: 0.9rem;
}

.progress-bar {
    background: #ecf0f1;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Sensor Grid */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sensor-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.sensor-card.large {
    grid-column: span 2;
}

.sensor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sensor-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.sensor-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.sensor-chart {
    height: 120px;
    margin: 1rem 0;
}

.sensor-gauge {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.gauge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#4CAF50 0% 75%, #ff9800 75% 90%, #f44336 90% 100%);
    position: relative;
}

.gauge-fill {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.sensor-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* GPS Layout */
.gps-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.gps-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background: #f8f9fa;
}

/* Charts */
.chart-container {
    height: 300px;
    position: relative;
}

/* Alerts */
.alert-section {
    margin-bottom: 1.5rem;
}

.alert-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-item.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-item.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-item.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

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

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

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

    .sensor-card.large {
        grid-column: span 1;
    }

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

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card, .sensor-card {
    animation: fadeIn 0.5s ease-out;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }

/* Status Colors */
.online { color: #28a745; }
.offline { color: #dc3545; }
.warning { color: #ffc107; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: " Loading...";
    animation: pulse 1.5s infinite;
}

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

/* Architecture Flow */
.architecture-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.step-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    min-width: 60px;
    text-align: center;
}

.step-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.step-content ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.step-content li {
    margin-bottom: 0.3rem;
    color: #5a6c7d;
}

.flow-arrow {
    text-align: center;
    font-size: 2rem;
    color: #667eea;
    margin: -0.5rem 0;
}

/* Pages Grid */
.pages-grid {
    display: grid;
    gap: 1rem;
}

.page-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.page-card:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    border-color: #5a6fd8;
}

.page-card:hover .page-info h4,
.page-card:hover .page-info p {
    color: white;
}

.page-icon {
    font-size: 2rem;
}

.page-info h4 {
    margin: 0 0 0.3rem 0;
    color: #2c3e50;
}

.page-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Specifications Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.spec-category h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.spec-category ul {
    list-style: none;
    padding: 0;
}

.spec-category li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    color: #5a6c7d;
}

.spec-category li:last-child {
    border-bottom: none;
}

.spec-category strong {
    color: #2c3e50;
}

/* System Metrics */
.system-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-label {
    font-weight: 500;
    color: #5a6c7d;
}

.metric-value {
    font-weight: 600;
    color: #2c3e50;
    background: #e9ecef;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Responsive Design for Overview */
@media (max-width: 768px) {
    .flow-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-icon {
        align-self: center;
    }
    
    .status-overview {
        grid-template-columns: 1fr;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    .system-metrics {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Fix untuk long text di mobile */
.flow-step, .step-content, .status-info p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Specific fix untuk HiveMQ text */
.step-content li {
    word-break: break-word;
    max-width: 100%;
}

/* Responsive text sizing untuk mobile */
@media (max-width: 768px) {
    .step-content {
        font-size: 0.9rem;
    }
    
    .step-content li {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .step-content strong {
        font-size: 0.9rem;
    }
    
    /* Break long URLs and technical terms */
    .architecture-flow code,
    .step-content li {
        word-break: break-all;
        word-wrap: break-word;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .flow-step {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .step-content ul {
        padding-left: 1rem;
    }
    
    .step-content li {
        margin-bottom: 0.5rem;
        padding: 0.3rem 0;
    }
}

/* Fix untuk long MQTT broker address */
.mqtt-address {
    font-family: monospace;
    font-size: 0.8rem;
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    word-break: break-all;
}

/* ===== SYSTEM STATUS OVERVIEW - FIXED BADGE ===== */
.status-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.status-item.comprehensive {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* HAPUS height: 140px - biarkan konten menentukan tinggi */
    min-height: 120px; /* hanya minimum height */
}

.status-item.comprehensive:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.status-item.comprehensive .status-icon {
    font-size: 2rem;
    margin-right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 12px;
    border-radius: 10px;
    color: white;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0; /* pastikan icon tidak mengecil */
}

.status-item.comprehensive .status-info {
    flex: 1;
    min-width: 0; /* penting untuk mencegah overflow */
}

.status-item.comprehensive .status-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
}

.status-item.comprehensive .status-info p {
    margin: 0 0 12px 0;
    color: #5a6c7d;
    font-size: 0.95rem;
    line-height: 1.4;
}

.status-badge.online {
    background: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-top: auto; /* ini yang penting - dorong badge ke bawah */
}

/* Responsive Design */
@media (max-width: 768px) {
    .status-overview {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .status-item.comprehensive {
        min-height: 110px;
        padding: 16px;
    }
}

/* ===== PERBAIKAN REAL-TIME SYSTEM STATUS ===== */
.system-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 3px solid #667eea;
    transition: all 0.3s ease;
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
}

.metric-label {
    font-weight: 500;
    color: #5a6c7d;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.metric-value {
    font-weight: 600;
    color: #2c3e50;
    background: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.95rem;
    border: 1px solid #e1e8ed;
}

/* Untuk card real-time system status agar full width */
.content-row:last-child .card {
    grid-column: 1 / -1;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 968px) {
    .system-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .system-metrics {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        padding: 12px 8px;
    }
}

/* Team Page Specific Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.member-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.member-nim {
    color: #666;
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.member-role {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Project Overview Styles */
.project-overview {
    line-height: 1.6;
}

.project-intro {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e1e8ed;
}

.project-tagline {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 500;
    margin-top: 0.5rem;
}

.project-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.project-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SDGs Grid */
.sdgs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sdg-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sdg-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    color: white;
}

/* Architecture */
.architecture-simple {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.arch-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.arch-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.arch-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.feature-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 0.8rem;
    border-radius: 10px;
    color: white;
    flex-shrink: 0;
}

/* Impact List */
.impact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.impact-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

/* Institution Card */
.institution-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.institution-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.institution-year {
    margin-top: 0.5rem;
    opacity: 0.9;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sdgs-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .arch-step {
        flex-direction: column;
        text-align: center;
    }
    
    .team-member {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== CONSISTENT STYLES FOR BOTH PAGES ===== */

/* Project Brief Section */
.project-brief {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.brief-content h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.brief-content p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.project-tagline {
    font-style: italic;
    font-size: 0.95rem;
}

.brief-sdgs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sdg-pill {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Full width card for real-time status */
.card.full-width {
    width: 100%;
}

/* Content row improvements */
.content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Architecture simple */
.architecture-simple {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.arch-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
}

.arch-step:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.arch-number {
    background: #667eea;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.arch-content h5 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.arch-content p {
    margin: 0 0 0.5rem 0;
    color: #5a6c7d;
    font-size: 0.9rem;
}

.arch-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

/* Features Grid */
.features-grid {
    display: grid;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 0.8rem;
    border-radius: 10px;
    color: white;
    flex-shrink: 0;
}

.feature-content h5 {
    margin: 0 0 0.3rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.feature-content p {
    margin: 0;
    color: #5a6c7d;
    font-size: 0.9rem;
}

/* Impact List */
.impact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.impact-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
}

.impact-item:hover {
    background: white;
    transform: translateX(5px);
}

/* Team Grid */
.team-grid {
    display: grid;
    gap: 1.2rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    background: white;
}

.member-avatar {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.member-info h4 {
    margin: 0 0 0.3rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.member-nim {
    color: #666;
    font-size: 0.85rem;
    margin: 0.2rem 0;
}

.member-role {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0;
}

/* Institution Card */
.institution-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-top: 1rem;
}

.institution-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.institution-year {
    margin-top: 0.5rem;
    opacity: 0.9;
    font-style: italic;
    font-size: 0.9rem;
}

/* Project Overview */
.project-overview {
    line-height: 1.6;
}

.project-section {
    margin-bottom: 1.5rem;
}

.project-section h4 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-section p {
    margin-bottom: 0.8rem;
    color: #5a6c7d;
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-row {
        grid-template-columns: 1fr;
    }
    
    .project-brief {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .brief-sdgs {
        justify-content: center;
    }
    
    .arch-step {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .team-member {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .arch-step {
        padding: 1rem;
    }
    
    .feature-item {
        padding: 0.8rem;
    }
    
    .team-member {
        padding: 1rem;
    }
}

/* ===== ENHANCED TEAM IDENTITY WITH IMAGES ===== */

/* Team Identity Styles */
.team-identity {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.team-logo-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.team-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    border-radius: 15px;
    object-fit: contain;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-logo-img {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.team-logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.team-logo .logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    letter-spacing: 2px;
}

.team-brand h2 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.team-tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.team-motto {
    margin-top: 1rem;
}

.motto-text {
    font-style: italic;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Institution Card with Image Logo */
.institution-card .institution-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.institution-logo-img {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
}

.institution-logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Fallback styling if images don't load */
.team-logo::before {
    content: "🛰️";
    font-size: 4rem;
    display: none;
}

.institution-logo::before {
    content: "🎓";
    font-size: 3rem;
    display: none;
}

/* Responsive Design for Team Identity */
@media (max-width: 768px) {
    .team-logo-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .team-brand h2 {
        font-size: 1.8rem;
    }

    .team-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .institution-card .institution-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .team-logo-img {
        width: 100px;
        height: 100px;
    }

    .team-logo .logo-text {
        font-size: 1.2rem;
    }

    .institution-logo-img {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .team-brand h2 {
        font-size: 1.5rem;
    }

    .team-logo-img {
        width: 80px;
        height: 80px;
    }

    .institution-logo-img {
        width: 60px;
        height: 60px;
    }
}

/* --- FIX TAMPILAN CHART --- */
.metric-chart {
    height: 250px; /* Kita kunci tingginya maksimal segini */
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Agar chart merespon container di atas */
.metric-chart canvas {
    max-height: 100% !important;
    max-width: 100% !important;
}
/* --- GANTI BAGIAN INI SAJA --- */

.nav-brand {
    background-color: white;     /* Latar belakang putih */
    padding: 5px 20px;           /* Jarak dalam agar tidak sesak */
    border-radius: 50px;         /* Membuat bentuk kapsul */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Efek timbul 3D */
    display: flex;
    align-items: center;
    margin-right: auto;          /* Agar posisi tetap rapi */
}

.nav-brand h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary);       /* Ubah teks jadi Biru agar terbaca */
    font-weight: 800;
    margin: 0;
}

.brand-logo {
    height: 35px;                /* Ukuran logo gambar */
    width: auto;
    object-fit: contain;
}

/* ===== MOBILE-FIRST BASE STYLES ===== */

/* Base styles yang bekerja untuk semua device */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation base */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Content layout base */
.content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== MOBILE BREAKPOINT (768px ke bawah) ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    /* Navigation mobile */
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-link {
        text-align: center;
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    /* Content layout mobile */
    .content-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sensor-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sensor-card.large {
        grid-column: span 1;
    }
    
    /* GPS layout mobile */
    .gps-content {
        grid-template-columns: 1fr;
    }
    
    /* Card adjustments mobile */
    .card {
        padding: 1.2rem;
    }
    
    /* Architecture flow mobile */
    .architecture-flow {
        gap: 1rem;
    }
    
    .flow-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-icon {
        align-self: center;
    }
}

/* ===== TABLET BREAKPOINT (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .sensor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ===== DESKTOP BREAKPOINT (1025px ke atas) ===== */
@media (min-width: 1025px) {
    /* Tampilan desktop optimal - tidak perlu perubahan karena base style sudah bagus */
    .sensor-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .content-row {
        grid-template-columns: 2fr 1fr;
    }
}

/* ===== EXTRA SMALL MOBILE (480px ke bawah) ===== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .nav-links {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .sensor-value {
        font-size: 1.3rem;
    }
}

/* ===== FIX UNTUK ELEMEN SPESIFIK ===== */

/* Navigation brand consistency */
.nav-brand {
    background-color: white;
    padding: 5px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

/* Architecture flow - konsisten di semua device */
.architecture-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

/* Sensor cards - responsive tapi konsisten */
.sensor-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

/* GPS page layout */
.gps-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .gps-content {
        grid-template-columns: 1fr;
    }
}

/* History page table */
.table-container {
    overflow-x: auto;
}

/* Team page specific */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .team-member {
        flex-direction: column;
        text-align: center;
    }
}

/* Transceiver performance */
.content-row[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .content-row[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
        grid-template-columns: 1fr;
    }
}

/* Gateway specifications */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ===== TOUCH FRIENDLY FOR MOBILE ===== */
@media (max-width: 768px) {
    .nav-link, .btn-primary, .btn-secondary {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    input, select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ===== IMPROVED READABILITY ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
}

/* ===== HORIZONTAL SCROLL PREVENTION ===== */
.container, .card, .sensor-card {
    max-width: 100%;
    overflow-x: hidden;
}

/* Chart responsiveness */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .sensor-chart {
        height: 100px;
    }
}