/* css/auditor.css */

.hidden {
    display: none !important;
}

/* Reusing base styles from ksef2pdf, but adding specific components */

.auditor-main {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    width: 100%;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

#target-url {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

#target-url:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dashboard {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Score Ring */
.score-card {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centered layout for impact */
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.score-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.ring-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.ring-progress {
    stroke: var(--accent-primary);
    /* Default color, JS changes it */
    stroke-dasharray: 339.292;
    /* 2 * PI * 54 */
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

#score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-percent {
    font-size: 1rem;
    color: var(--text-muted);
}

.score-grade {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-card h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Report List */
.report-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent-primary);
    padding-left: 12px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.report-item:last-child {
    border-bottom: none;
}

.report-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.pass {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge.fail {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.report-detail {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
    max-width: 300px;
}

/* === Tabs Navigation === */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    /* Space between tabs and content */
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
    margin-top: 40px;
    /* Space between Stats Grid and Tabs */
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    color: #fff;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* === Print Styles === */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .dashboard {
        box-shadow: none;
        border: 1px solid #ccc;
        backdrop-filter: none;
    }

    .score-card {
        gap: 20px;
    }

    /* Hide UI elements */
    .search-box,
    .app-header button,
    .app-footer,
    .tabs-nav,
    .terminal-actions {
        display: none !important;
    }

    .terminal-window {
        border: 1px solid #000;
        background: #fff;
        color: #000;
        height: auto;
    }
}

/* === Terminal Window (Fallout Style) === */
.terminal-section {
    margin-top: 0;
    animation: fadeIn 0.8s ease-out;
}

.terminal-section h3 {
    font-family: 'JetBrains Mono', monospace;
    color: #4ade80;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1rem;
}

.terminal-window-wrapper {
    position: relative;
    border: 2px solid #4ade80;
    border-radius: 6px;
    padding: 2px;
    /* Inner border effect */
    background: #000;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.terminal-window {
    background-color: #0c0c0c;
    color: #4ade80;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    text-shadow: 0 0 4px rgba(74, 222, 128, 0.6);
    position: relative;
}

/* Scanline effect */
.terminal-window::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Scrollbar Customization for Terminal */
.terminal-window::-webkit-scrollbar {
    width: 8px;
}

.terminal-window::-webkit-scrollbar-track {
    background: #000;
}

.terminal-window::-webkit-scrollbar-thumb {
    background: #4ade80;
    border-radius: 0;
}

.terminal-line {
    margin-bottom: 2px;
}

.terminal-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    background: #000;
    border-top: 1px solid #4ade80;
}

.btn-terminal {
    background: transparent;
    color: #4ade80;
    border: 1px solid #4ade80;
    border-radius: 0;
    padding: 5px 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn-terminal:hover {
    background: #4ade80;
    color: #000;
    box-shadow: 0 0 10px #4ade80;
    cursor: pointer;
}

.btn-terminal:active {
    transform: translateY(1px);
}