/* css/style.css - Mikrotik Wireless Link Planner */

:root {
    --bg: #050816;
    --bg-alt: #0b1020;
    --card-bg: rgba(20, 28, 48, 0.92);
    --border-subtle: rgba(255,255,255,0.06);
    --accent: #26c6da;
    --accent-soft: rgba(38, 198, 218, 0.16);
    --accent-strong: #00e5ff;
    --text-main: #f5f7ff;
    --text-muted: #a0acc7;
    --danger: #ff6b6b;
    --warning: #ffb84d;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --shadow-soft: 0 18px 45px rgba(0,0,0,0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: radial-gradient(circle at top, #162447 0, #050816 45%, #02030a 100%);
    color: var(--text-main);
}

body {
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */

.app-header {
    padding: 18px 18px 8px;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(18px);
    background: linear-gradient(to bottom, rgba(5, 8, 22, 0.94), rgba(5, 8, 22, 0.75));
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 20%, #e1f5fe 0, #26c6da 38%, #004d61 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #021318;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 16px 35px rgba(0,0,0,0.6);
}

.brand-text h1 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.brand-text p {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main layout */

.app-main {
    flex: 1;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1.6fr);
    gap: 18px;
}

.card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    padding: 18px 18px 20px;
    box-shadow: var(--shadow-soft);
}

.glass {
    background: radial-gradient(circle at top left, rgba(38, 198, 218, 0.10), transparent 60%),
                linear-gradient(135deg, rgba(12, 20, 38, 0.94), rgba(5, 8, 22, 0.98));
}

.info-card {
    background: linear-gradient(160deg, rgba(19, 30, 58, 0.96), rgba(7, 10, 26, 0.98));
}

.section-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Form */

.planner-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

input[type="number"],
select {
    background: rgba(5, 12, 28, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 8px 11px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    appearance: none;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(38, 198, 218, 0.45);
    background: rgba(6, 16, 36, 0.98);
}

small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Buttons */

.btn-primary,
.btn-ghost {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021318;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0,0,0,0.65);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-ghost {
    background: rgba(5, 10, 24, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-main);
}

.btn-ghost:hover {
    background: rgba(12, 20, 40, 0.96);
}

/* Advanced panel */

#advancedToggle {
    align-self: flex-start;
    margin-top: 4px;
}

.chevron {
    font-size: 0.75rem;
    opacity: 0.85;
}

.advanced-panel {
    margin-top: 4px;
    padding: 10px 12px 6px;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top left, var(--accent-soft), transparent 60%);
    border: 1px dashed rgba(255,255,255,0.14);
    display: none;
}

.advanced-panel.open {
    display: block;
}

/* Info card */

.info-list {
    margin: 10px 0 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.info-list li {
    margin-bottom: 6px;
}

/* Form actions */

.form-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

/* Footer */

.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 10px 18px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(2, 4, 12, 0.95);
}

/* Results page */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.criteria-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.criteria-list li {
    margin-bottom: 4px;
}

.actions-right {
    display: flex;
    align-items: flex-start;
}

.alert-warning {
    background: rgba(255, 184, 77, 0.12);
    border: 1px solid rgba(255, 184, 77, 0.55);
    color: #ffe2b3;
    border-radius: 14px;
    padding: 8px 10px;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.no-results {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: rgba(32, 22, 35, 0.96);
    border: 1px solid rgba(255,255,255,0.06);
}

.no-results h3 {
    margin-top: 0;
}

.no-results ul {
    margin-top: 6px;
    padding-left: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Device cards */

.results-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.device-card {
    border-radius: 20px;
    background: radial-gradient(circle at top left, rgba(38, 198, 218, 0.12), rgba(7, 10, 26, 0.98));
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.55);
}

.device-header h3 {
    margin: 0;
    font-size: 0.98rem;
}

.device-subtitle {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-rank {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(38, 198, 218, 0.12);
    border: 1px solid rgba(38, 198, 218, 0.7);
    font-size: 0.7rem;
    color: var(--accent-strong);
    margin-bottom: 4px;
}

.device-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.metric {
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(4, 10, 22, 0.92);
    border: 1px solid rgba(255,255,255,0.06);
}

.metric-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.metric-value {
    display: block;
    font-size: 0.9rem;
    margin-top: 2px;
}

.device-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.68rem;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(2, 6, 18, 0.96);
    color: var(--text-muted);
}

.tag.role {
    border-color: rgba(38, 198, 218, 0.8);
    color: var(--accent-strong);
}

.tag.mimo {
    border-color: rgba(129, 199, 132, 0.7);
}

.tag.poe {
    border-color: rgba(144, 164, 174, 0.7);
}

.tag.integrated {
    border-color: rgba(129, 212, 250, 0.7);
}

.tag.connectorized {
    border-color: rgba(239, 154, 154, 0.8);
}

.tag.nv2 {
    border-color: rgba(186, 104, 200, 0.85);
}

.device-notes {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Responsive */

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 14px 12px 6px;
    }

    .app-main {
        padding: 12px;
    }

    .card {
        padding: 14px 12px 16px;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1.05rem;
    }
}


.support-box {
    margin-top: 16px;
    padding: 12px 12px 10px;
    border-radius: 18px;
    background: radial-gradient(circle at top left, rgba(38, 198, 218, 0.16), rgba(3, 7, 18, 0.96));
    border: 1px solid rgba(38, 198, 218, 0.45);
}

.support-box h4 {
    margin: 0 0 6px;
    font-size: 0.98rem;
}

.support-box p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.support-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-support {
    width: 100%;
    text-align: center;
    justify-content: center;
    line-height: 1.3;
}

.btn-subtext {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
}

.support-inline {
    margin-top: 12px;
    padding: 10px 12px 10px;
    border-radius: 16px;
    background: rgba(5, 12, 30, 0.94);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.support-inline-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-support-small {
    font-size: 0.85rem;
    padding-inline: 12px;
}

@media (min-width: 640px) {
    .support-actions {
        flex-direction: row;
    }
}

