/* LAQI OTA Update Page Styles */
/* Theme: Laqi.co design (Navy #113D5B, Yellow #F0C417, Barlow font) */

:root {
    --laqi-navy: #113D5B;
    --laqi-navy-dark: #0A2A3F;
    --laqi-navy-light: #1A5273;
    --laqi-yellow: #F0C417;
    --laqi-yellow-dark: #D4A912;
    --laqi-yellow-light: #F5D647;

    --status-success: #27ae60;
    --status-warning: #f39c12;
    --status-error: #e74c3c;
    --status-info: #3498db;
    --status-disabled: #95a5a6;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --border-color: #E0E0E0;

    --font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(17, 61, 91, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: var(--laqi-navy);
    color: white;
    padding: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-logo {
    height: 32px;
    width: auto;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Navigation Bar */
.client-nav {
    display: flex;
    gap: 0;
    background: var(--laqi-navy-dark);
    padding: 0 30px;
}

.client-nav-link {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.client-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.client-nav-link.active {
    color: white;
    border-bottom-color: var(--laqi-yellow);
}

/* Panels */
.panel {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.panel:last-child {
    border-bottom: none;
}

.panel h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--laqi-navy);
    margin-bottom: 20px;
}

/* Connection */
.connection-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.connection-status {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.connection-status.connected {
    color: var(--status-success);
}

.connection-status.connecting {
    color: var(--status-warning);
}

.connection-status.error {
    color: var(--status-error);
}

/* Device info */
.device-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--laqi-navy);
}

.info-value-warn {
    color: var(--status-error);
}

/* File picker */
.file-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.file-label {
    cursor: pointer;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manifest-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 16px;
}

/* Update controls */
.update-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

/* Progress */
.progress-section {
    margin-top: 16px;
}

.phase-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--laqi-navy);
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--laqi-navy) 0%, var(--laqi-navy-light) 100%);
    transition: width 0.5s ease;
    border-radius: 20px;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 1;
    color: var(--laqi-navy);
    transition: color 0.3s ease;
}

/* Status message */
.status-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.status-message.success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--status-success);
    border-left: 4px solid var(--status-success);
}

.status-message.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--status-error);
    border-left: 4px solid var(--status-error);
}

.status-message.info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--status-info);
    border-left: 4px solid var(--status-info);
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-family);
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--laqi-navy);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--laqi-navy-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 61, 91, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    body { padding: 10px; }
    .panel { padding: 20px 16px; }
    .header { padding: 20px; }
    .header h1 { font-size: 1.5rem; }
    .client-nav { padding: 0 16px; }
    .client-nav-link { padding: 10px 14px; font-size: 0.85rem; }
    .btn { padding: 12px 24px; font-size: 0.9rem; }
}
