﻿/*
 * LaunchCompass
 * Copyright (c) 2026 Robert Morgan / RMC Software Solutions, LLC
 * All rights reserved.
 * 
 * This software is proprietary and confidential.
 * Unauthorized copying, modification, distribution, or use is strictly prohibited.
 * 
 * File: wwwroot\css\app.css
 * Author: Robert Morgan
 * Version: 1.0.0
 * Created: 01/15/2026
 * Modified: 01/27/2026
 * Released: 00/00/0000
 * 
 * Description:
 *     Main application stylesheet defining CSS custom properties (variables) and base styles.
 *     Includes layout for compass app, selectors, buttons, modals, and info panels.
 *     Establishes color scheme and typography for the entire application.
 * 
 * MVVM Role: Styling
 * Architecture: CSS Variables | Mobile-First | Responsive
*/

/* wwwroot/css/app.css */

/* ==========================================
   BASE STYLES
   ========================================== */
:root {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-orange: #f97316;
    --accent-orange-dark: #ea580c;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --border-color: #4b5563;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    min-height: 100vh;
}

/* ==========================================
   MAIN COMPASS APP LAYOUT
   ========================================== */
.compass-app {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

    .compass-app header {
        text-align: center;
        width: 100%;
    }

    .compass-app h1 {
        font-size: 1.5rem;
        color: var(--accent-orange);
        margin-bottom: 8px;
    }

/* ==========================================
   SELECTORS
   ========================================== */
.selector-group {
    width: 100%;
}

    .selector-group label {
        display: block;
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin-bottom: 4px;
    }

    .selector-group select {
        width: 100%;
        padding: 12px;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        cursor: pointer;
    }

        .selector-group select:focus {
            outline: none;
            border-color: var(--accent-orange);
        }

/* Pad Selector Row with Settings Button */
.pad-selector-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .pad-selector-row select {
        flex: 1;
        padding: 12px;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        cursor: pointer;
    }

        .pad-selector-row select:focus {
            outline: none;
            border-color: var(--accent-orange);
        }

.settings-btn {
    padding: 10px 14px;
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .settings-btn:hover {
        background: rgba(0, 212, 255, 0.15);
    }

.location-row {
    display: flex;
    gap: 8px;
}

    .location-row select {
        flex: 1;
    }

.icon-btn {
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .icon-btn:hover {
        background-color: var(--bg-tertiary);
    }

/* ==========================================
   ENABLE BUTTON
   ========================================== */
.enable-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--accent-orange-dark);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .enable-btn:hover {
        background-color: var(--accent-orange);
    }

/* ==========================================
   ERROR BOX
   ========================================== */
.error-box {
    width: 100%;
    padding: 12px;
    background-color: rgba(127, 29, 29, 0.5);
    border: 1px solid var(--accent-red);
    border-radius: 8px;
    color: #fca5a5;
}

/* ==========================================
   COMPASS ROSE
   ========================================== */
.compass-rose {
    width: 180px;
    height: 180px;
}

    .compass-rose svg {
        width: 100%;
        height: 100%;
    }

/* ==========================================
   ON TARGET INDICATOR
   ========================================== */
.on-target {
    width: 100%;
    padding: 16px;
    background-color: rgba(20, 83, 45, 0.8);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   ELEVATION INDICATOR
   ========================================== */
.elevation-indicator {
    width: 100%;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.elevation-header {
    margin-bottom: 8px;
}

.elevation-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.elevation-display {
    text-align: center;
    margin-bottom: 12px;
}

.elevation-value-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-orange);
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
}

.elevation-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.elevation-visual {
    margin: 8px 0;
}

    .elevation-visual svg {
        width: 100%;
        height: auto;
        border-radius: 4px;
        overflow: hidden;
    }

.trajectory-note {
    padding-top: 8px;
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ==========================================
   INFO PANEL
   ========================================== */
.info-panel {
    width: 100%;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row.highlight {
        background-color: rgba(249, 115, 22, 0.1);
        margin: 0 -12px;
        padding: 8px 12px;
    }

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    color: var(--text-primary);
}

    .info-value.small {
        font-size: 0.75rem;
    }

    .info-value.error {
        color: var(--accent-red);
    }

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

    .modal h3 {
        margin-bottom: 16px;
    }

    .modal input[type="text"] {
        width: 100%;
        padding: 12px;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        margin-bottom: 16px;
    }

        .modal input[type="text"]:focus {
            outline: none;
            border-color: var(--accent-orange);
        }

.modal-buttons {
    display: flex;
    gap: 12px;
}

    .modal-buttons button {
        flex: 1;
        padding: 12px;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
    }

        .modal-buttons button:first-child {
            background-color: var(--accent-orange);
            color: white;
        }

        .modal-buttons button.secondary {
            background-color: var(--bg-tertiary);
            color: var(--text-primary);
        }

/* ==========================================
   DESKTOP TEST CONTROLS
   ========================================== */
.test-controls {
    width: 100%;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px dashed var(--accent-blue);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

    .test-controls h3 {
        font-size: 0.875rem;
        color: var(--accent-blue);
        margin-bottom: 12px;
    }

.test-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

    .test-row label {
        font-size: 0.75rem;
        color: var(--text-secondary);
        white-space: nowrap;
    }

    .test-row input[type="range"] {
        flex: 1;
    }

    .test-row span {
        font-family: monospace;
        font-size: 0.875rem;
        min-width: 40px;
    }

.test-controls button {
    padding: 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

    .test-controls button:hover {
        background-color: var(--border-color);
    }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 360px) {
    .compass-rose {
        width: 240px;
        height: 240px;
    }

    .compass-app h1 {
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) {
    .compass-app {
        padding: 24px;
    }

    .compass-rose {
        width: 320px;
        height: 320px;
    }
}

/* ==========================================
   DEBUG INDICATOR - Remove when confirmed
   ========================================== */
body::after {
    content: "";
    position: fixed;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 50%;
    z-index: 999999;
    box-shadow: 0 0 10px red;
}
