/* ========================================
   FK94 Security Audit Tool - Styles
   ======================================== */

:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #18181b;
    --bg-card: #1a1a1d;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========================================
   Header
   ======================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.logo-suffix {
    font-weight: 400;
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   Buttons
   ======================================== */

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
}

/* ========================================
   Main Layout
   ======================================== */

.app-main {
    display: flex;
    min-height: calc(100vh - 65px);
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 24px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.progress-container {
    margin-bottom: 24px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.section-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    color: var(--text-secondary);
}

.section-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.section-nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.section-nav-item.completed {
    color: var(--text-muted);
}

.nav-item-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.section-nav-item.active .nav-item-number {
    background: var(--accent);
    color: #000;
}

.section-nav-item.completed .nav-item-number {
    background: var(--success);
    color: #000;
}

.nav-item-text {
    font-size: 14px;
    font-weight: 500;
}

.nav-item-status {
    margin-left: auto;
    font-size: 12px;
}

/* ========================================
   Content Area
   ======================================== */

.content {
    flex: 1;
    padding: 32px;
    max-width: 900px;
}

.audit-section {
    display: none;
}

.audit-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   Cards
   ======================================== */

.section-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.auto-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* ========================================
   Input Groups
   ======================================== */

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
}

.input::placeholder {
    color: var(--text-muted);
}

/* ========================================
   Results Container
   ======================================== */

.results-container {
    min-height: 60px;
}

.results-container:empty::before {
    content: 'Results will appear here after scanning';
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.result-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.result-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.result-icon.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.result-icon.info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.result-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

.result-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    word-break: break-all;
}

.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Checklist
   ======================================== */

.checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.check-item:hover {
    border-color: var(--border-color);
}

.check-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 2px;
}

.check-item input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.check-item input:checked + .checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.check-item.completed {
    opacity: 0.6;
}

.check-content {
    flex: 1;
}

.check-title {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.check-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========================================
   Tabs
   ======================================== */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

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

/* ========================================
   Navigation Buttons
   ======================================== */

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

#prevBtn:disabled,
#nextBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.modal-body pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
    .app-main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .section-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-nav-item {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    .nav-item-status {
        display: none;
    }

    .content {
        padding: 24px 16px;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 12px 16px;
    }

    .header-actions {
        gap: 8px;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-small svg {
        display: none;
    }

    .input-group {
        flex-direction: column;
    }

    .tabs {
        flex-direction: column;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .nav-buttons button {
        width: 100%;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Breach Results Specific
   ======================================== */

.breach-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.breach-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
}

.breach-item .breach-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--danger);
}

.breach-item .breach-date {
    font-size: 12px;
    color: var(--text-muted);
}

.breach-item .breach-data {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.no-breaches {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    color: var(--success);
}
