/* ============================================
   FEDSHIELD - Modern Cybersecurity Dashboard
   Apple-inspired minimal, clean aesthetic
   ============================================ */

/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Core Colors - Elegant & Professional */
    --primary: #0A3F5C;           /* Deep Blue */
    --primary-light: #1A5F7F;     /* Lighter Blue */
    --accent: #00B4D8;            /* Cyan Accent */
    --accent-dark: #0096C7;       /* Darker Cyan */
    --success: #06A77D;           /* Green */
    --warning: #F77F00;           /* Orange */
    --danger: #D62828;            /* Red */
    --critical: #A4161A;          /* Dark Red */
    
    /* Neutrals - Apple-inspired */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;      /* Ultra light gray */
    --bg-tertiary: #EBEBF0;       /* Light gray */
    --text-primary: #1D1D1F;      /* Almost black */
    --text-secondary: #86868B;    /* Medium gray */
    --border-color: #D2D2D7;      /* Border gray */
    
    /* Spacing & Size */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.shield-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.logo-text {
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
}

/* ============================================
   MAIN CONTAINER & SECTIONS
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

section {
    margin-bottom: 4rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   SCAN SECTION
   ============================================ */

.scan-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.scan-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.scan-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scan-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.2rem;
}

.scan-status {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.scan-status.hidden {
    display: none;
}

.status-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#statusText {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   DASHBOARD - METRICS
   ============================================ */

.dashboard-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: var(--bg-primary);
    border: 2px solid;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.metric-card.critical {
    border-color: var(--critical);
    background: linear-gradient(135deg, rgba(164, 22, 26, 0.05) 0%, rgba(214, 40, 40, 0.05) 100%);
}

.metric-card.high {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(214, 40, 40, 0.05) 0%, rgba(247, 127, 0, 0.05) 100%);
}

.metric-card.medium {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(247, 127, 0, 0.05) 0%, rgba(0, 180, 216, 0.05) 100%);
}

.metric-card.low {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(6, 168, 125, 0.05) 0%, rgba(0, 180, 216, 0.05) 100%);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-card.critical .metric-value {
    color: var(--critical);
}

.metric-card.high .metric-value {
    color: var(--danger);
}

.metric-card.medium .metric-value {
    color: var(--warning);
}

.metric-card.low .metric-value {
    color: var(--success);
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   COMPLIANCE SCORE
   ============================================ */

.compliance-score {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
}

.score-circle {
    width: 200px;
    height: 200px;
    position: relative;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-background {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.score-info h3 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.score-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.control-families h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.control-families ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    list-style: none;
}

.control-families li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.control-families strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   VULNERABILITIES LIST
   ============================================ */

.vulnerabilities-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.vulnerabilities-section h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.vulnerabilities-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vulnerability-item {
    background: var(--bg-secondary);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vulnerability-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.vulnerability-item.severity-critical {
    border-left-color: var(--critical);
}

.vulnerability-item.severity-high {
    border-left-color: var(--danger);
}

.vulnerability-item.severity-medium {
    border-left-color: var(--warning);
}

.vulnerability-item.severity-low {
    border-left-color: var(--success);
}

.vulnerability-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.vulnerability-title {
    font-weight: 600;
    color: var(--text-primary);
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background-color: rgba(164, 22, 26, 0.2);
    color: var(--critical);
}

.severity-badge.high {
    background-color: rgba(214, 40, 40, 0.2);
    color: var(--danger);
}

.severity-badge.medium {
    background-color: rgba(247, 127, 0, 0.2);
    color: var(--warning);
}

.severity-badge.low {
    background-color: rgba(6, 168, 125, 0.2);
    color: var(--success);
}

.vulnerability-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.vulnerability-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.nist-control {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   COMPLIANCE SECTION
   ============================================ */

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.control-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.control-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.control-card.control-ac { border-top: 3px solid #3B82F6; }
.control-card.control-au { border-top: 3px solid #8B5CF6; }
.control-card.control-cm { border-top: 3px solid #10B981; }
.control-card.control-ia { border-top: 3px solid #F59E0B; }
.control-card.control-sc { border-top: 3px solid #EF4444; }
.control-card.control-si { border-top: 3px solid #06B6D4; }

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.control-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Monaco', monospace;
}

.control-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.control-status.pass {
    background-color: rgba(6, 168, 125, 0.2);
    color: var(--success);
}

.control-status.fail {
    background-color: rgba(214, 40, 40, 0.2);
    color: var(--danger);
}

.control-status.warning {
    background-color: rgba(247, 127, 0, 0.2);
    color: var(--warning);
}

.control-status.pending {
    background-color: rgba(134, 134, 139, 0.2);
    color: var(--text-secondary);
}

.control-card h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.control-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.findings-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.findings-list .finding-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.findings-list .finding-item:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ============================================
   DETAILED REPORT
   ============================================ */

.report-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.report-section h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.detailed-report {
    color: var(--text-secondary);
}

.report-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.report-item:last-child {
    border-bottom: none;
}

.report-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.report-item p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

#modalBody h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#modalBody .severity {
    margin-bottom: 1rem;
}

#modalBody p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .compliance-score {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .navbar-container {
        padding: 0.75rem 1rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .modal-content {
        margin: 1rem;
        max-width: none;
    }
}

/* SVG Gradient for Score Circle */
@supports (background: conic-gradient(from 0deg, red, blue)) {
    .score-progress {
        stroke: url(#scoreGradient);
    }
}

/* ============================================
   HACKATHON MULTI-TARGET SCANNER
   ============================================ */

.hackathon-section {
    animation: fadeIn 0.4s ease;
}

.hackathon-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.scan-all-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #06A87D 0%, #00B4D8 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scan-all-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scan-all-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.clear-button {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.scan-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.scan-progress.hidden {
    display: none;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #06A87D, #00B4D8);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.leaderboard h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover td {
    background: var(--bg-secondary);
}

.rank-cell {
    font-weight: 700;
    color: var(--text-secondary);
    width: 40px;
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

.team-name {
    font-weight: 600;
    color: var(--primary);
    text-transform: capitalize;
}

.team-name.current-team {
    color: var(--accent);
}

.account-id {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.url-input-cell {
    min-width: 260px;
}

.url-input-cell input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.url-input-cell input:focus {
    outline: none;
    border-color: var(--accent);
}

.score-cell {
    font-weight: 700;
    font-size: 1rem;
    min-width: 60px;
}

.score-high { color: var(--success); }
.score-medium { color: var(--warning); }
.score-low { color: var(--danger); }
.score-pending { color: var(--text-secondary); }

.count-cell {
    text-align: center;
    font-weight: 600;
    min-width: 55px;
}

.count-critical { color: var(--critical); }
.count-high { color: var(--danger); }
.count-medium { color: var(--warning); }
.count-low { color: var(--success); }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: rgba(150, 150, 150, 0.15);
    color: var(--text-secondary);
}

.status-scanning {
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent);
    animation: pulse 1s infinite;
}

.status-complete {
    background: rgba(6, 168, 125, 0.15);
    color: var(--success);
}

.status-error {
    background: rgba(214, 40, 40, 0.15);
    color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.scan-row-button {
    padding: 0.35rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.scan-row-button:hover {
    background: var(--primary-light);
}

.scan-row-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
