/**
 * Common Styles for MQTT Control Center
 * Shared across all pages: index.html, logs.html, io-module.html
 * Version: 3.0
 */

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.nav-buttons-container {
    text-align: center;
    margin: 20px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-block;
    padding: 12px 30px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn-charts {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn-logs {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.nav-btn-io {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* Back Button */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    display: inline-block;
}

.badge-origin {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-device {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-type {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-status {
    font-size: 0.85em;
    padding: 5px 12px;
}

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

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

/* ============================================
   BUTTONS
   ============================================ */

button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* ============================================
   LOADING & STATUS
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 1.2em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Navigation buttons stack vertically on mobile */
    .nav-buttons-container {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }

    .nav-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        min-height: 50px;
        box-sizing: border-box;
    }

    /* Back button full width on mobile */
    .back-btn {
        display: block;
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        min-height: 50px;
        box-sizing: border-box;
    }

    /* Buttons */
    button {
        width: 100%;
        min-height: 48px;
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Badges */
    .badge {
        font-size: 0.7em;
        padding: 3px 6px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}
