@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #080c18;
    --card-bg: rgba(20, 27, 47, 0.75);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Neon light indicators based on airport lighting standard */
    --status-normal: #00e676; /* Runway Green */
    --status-warning: #ffab00; /* Runway Amber */
    --status-danger: #ff1744; /* Obstruction Red */
    --status-info: #00b0ff; /* Taxiway Blue */
    
    --primary: var(--status-info);
    --primary-hover: #0091ea;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-glow: 0 0 15px rgba(0, 176, 255, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 176, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    padding-bottom: 40px; /* Space for mobile view */
}

/* Container for mobile alignment */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.header-title-area {
    display: flex;
    flex-direction: column;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glowing Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-back:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.92);
}

/* Primary Top Action Button */
.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #0091ea 100%);
    border: none;
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-action-primary:active {
    transform: scale(0.95);
    box-shadow: 0 0 8px rgba(0, 176, 255, 0.2);
}

/* Device Overview Card (Hero) */
.device-hero-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.device-hero-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 176, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.device-code-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.device-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.25;
}

/* Status Indicator Group */
.status-indicator-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 1.8s infinite;
}

.status-normal .status-dot, .status-normal .status-dot::after { background-color: var(--status-normal); }
.status-warning .status-dot, .status-warning .status-dot::after { background-color: var(--status-warning); }
.status-danger .status-dot, .status-danger .status-dot::after { background-color: var(--status-danger); }
.status-info .status-dot, .status-info .status-dot::after { background-color: var(--status-info); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1); opacity: 0.4; }
}

.status-text {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-normal .status-text { color: var(--status-normal); }
.status-warning .status-text { color: var(--status-warning); }
.status-danger .status-text { color: var(--status-danger); }
.status-info .status-text { color: var(--status-info); }

/* Information Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sections with Accordion style or beautiful container */
.section-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: 8px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Properties List */
.properties-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.property-item:last-child {
    border-bottom: none;
}

.property-key {
    color: var(--text-secondary);
}

.property-val {
    font-weight: 500;
    color: var(--text-primary);
}

/* Timeline/Records list */
.timeline {
    position: relative;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 6px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-maintainer {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.timeline-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-badge {
    font-size: 0.7rem;
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    margin-top: 4px;
}

.badge-level-1 { background: rgba(0, 176, 255, 0.15); color: var(--status-info); border: 1px solid rgba(0, 176, 255, 0.2); }
.badge-level-2 { background: rgba(255, 171, 0, 0.15); color: var(--status-warning); border: 1px solid rgba(255, 171, 0, 0.2); }
.badge-level-3 { background: rgba(255, 23, 68, 0.15); color: var(--status-danger); border: 1px solid rgba(255, 23, 68, 0.2); }

/* Form Control */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 176, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Radio Group styling */
.radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: rgba(0, 176, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 176, 255, 0.15);
}

/* Level Indicator Colors inside Radio Labels */
.radio-option.opt-normal input[type="radio"]:checked + .radio-label {
    background: rgba(0, 230, 118, 0.08);
    border-color: var(--status-normal);
    color: var(--status-normal);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}
.radio-option.opt-warning input[type="radio"]:checked + .radio-label {
    background: rgba(255, 171, 0, 0.08);
    border-color: var(--status-warning);
    color: var(--status-warning);
    box-shadow: 0 0 10px rgba(255, 171, 0, 0.15);
}
.radio-option.opt-danger input[type="radio"]:checked + .radio-label {
    background: rgba(255, 23, 68, 0.08);
    border-color: var(--status-danger);
    color: var(--status-danger);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.15);
}

/* Buttons */
.btn-submit {
    background: linear-gradient(135deg, var(--status-normal) 0%, #00b0ff 100%);
    border: none;
    color: #070b19;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: 10px;
}

.btn-submit:active {
    transform: scale(0.97);
    box-shadow: 0 0 5px rgba(0, 230, 118, 0.15);
}

/* Dashboard Device list cards */
.dashboard-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device-item-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.device-item-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
}

.device-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-item-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.device-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-item-code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 4px;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--card-border);
    border-radius: var(--radius-md);
}

/* NFC NFC Tag Simulator section */
.nfc-instruction-box {
    background: rgba(0, 176, 255, 0.05);
    border: 1px dashed var(--status-info);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nfc-instruction-box h4 {
    color: var(--status-info);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nfc-link-copy {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    border: 1px solid var(--card-border);
}

.copy-btn {
    color: var(--status-info);
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn:active {
    opacity: 0.7;
}

/* Tab menu */
.tab-container {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
