﻿/* General Styles */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 50px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header Actions */
.header-actions {
    margin-bottom: 25px;
    display: flex;
    justify-content: flex-end;
}

.header-actions a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    padding: 8px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00b894 0%, #00a383 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,184,148,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,184,148,0.3);
    background: linear-gradient(135deg, #00a383 0%, #009374 100%);
}

.header-actions a::before {
    content: '↗';
    font-size: 16px;
    line-height: 1;
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 56px;
    display: flex;
    align-items: center;
}

.navbar-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.navbar-brand-r {
    color: #00b894;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.navbar-brand:hover, .navbar-brand-r:hover {
    color: #00b894;
}

.navbar-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #00b894 0%, #00a383 100%);
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 6px rgba(0,184,148,0.2);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #00a383 0%, #009374 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,184,148,0.3);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,184,148,0.25);
}

/* Hide ADB Port Section */
#adb-port-section {
    display: none;
}

/* Cards (formerly panels) */
.panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.panel-heading {
    background-color: #ffffff;
    border-bottom: 1px solid #eef2f7;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.2;
}

.panel-body {
    padding: 15px;
}

.panel-footer {
    background-color: #ffffff;
    border-top: 1px solid #eef2f7;
    padding: 15px;
    border-radius: 0 0 12px 12px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.2);
}

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

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.2);
}

.btn-warning {
    background-color: #ffc107;
    color: #000000;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,193,7,0.2);
}

/* Modern Popup Styles */
#log-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

#log-window {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1001;
    width: 580px;
    min-width: 580px;
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
}

.log-content {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    width: 540px;
    min-width: 540px;
    box-sizing: border-box;
}

#log-window h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
    width: 100%;
    box-sizing: border-box;
}

#log-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #eef2f7;
    margin: 0;
    width: 500px;
    min-width: 500px;
    flex-shrink: 0;
    box-sizing: border-box;
}

#log-window .btn-danger {
    align-self: flex-end;
    margin: 0;
    min-width: 100px;
}

/* Scrollbar Styles for Log Content */
#log-content::-webkit-scrollbar {
    width: 8px;
}

#log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#log-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#log-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Progress Bar Container */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.progress-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.progress {
    height: 8px;
    background-color: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
    width: 100%;
}

.progress-bar {
    height: 100%;
    background-color: #00b894;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 10px;
    color: #2c3e50;
    font-size: 14px;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 14px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.input-group .form-control:focus {
    outline: none;
    border-color: #00b894;
    box-shadow: 0 0 0 2px rgba(0,184,148,0.1);
}

.input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Badge Styles */
.badge {
    background-color: #00b894;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: none;
    background-color: #fff3cd;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background-color: #fff5f5;
    color: #e53e3e;
    border-left: 4px solid #e53e3e;
}

/* Adjust gap between navbar and content */
.container-fluid, .container {
    padding-top: 5px;
}

#nowebusb, .panel, .alert {
    margin-top: 10px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-actions {
        margin-bottom: 20px;
    }
    
    .header-actions a {
        font-size: 14px;
        padding: 6px 14px;
    }
    
    #log-window {
        width: 95%;
        min-width: 300px;
    }
    
    .log-content {
        width: 100%;
        min-width: 0;
        padding: 15px;
    }
    
    #log-content {
        width: 100%;
        min-width: 0;
        height: 120px;
        font-size: 13px;
    }
    
    #log-window h3 {
        font-size: 16px;
    }
    
    .navbar {
        height: 50px;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .navbar-buttons {
        gap: 8px;
    }
    
    .navbar-header {
        padding: 0 15px;
    }
    
    .device-status {
        gap: 10px;
        padding: 8px;
    }
    
    .device-info {
        padding: 6px 12px;
        min-width: 100px;
    }
    
    .input-group {
        gap: 8px;
    }
}

/* Disable page interaction during installation */
.page-disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Ensure footer text doesn't stick to edges */
.panel-footer {
    margin: 0;
    padding: 15px 20px;
    line-height: 1.8;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    flex-wrap: nowrap;
}

.device-info {
    flex: 1;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    min-width: 120px;
}

.device-name {
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.device-status .btn {
    padding: 8px 15px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
}