@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-dark: #121212;
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(0, 0, 0) 0%, rgb(20, 20, 20) 90%);

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);

    --text-main: #ffffff;
    --text-muted: #e0e0e0;

    --accent-blue: #00d4ff;
    --accent-red: #ff4757;
    --accent-green: #00ffc8;

    --glow-blue: 0 0 15px rgba(0, 212, 255, 0.3);
    --glow-red: 0 0 15px rgba(255, 71, 87, 0.3);
    --glow-green: 0 0 15px rgba(0, 255, 200, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Atmosphere */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 10%, rgba(0, 212, 255, 0.05), transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(0, 255, 200, 0.05), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    padding: 40px 0 20px;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #bbb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shield-icon {
    font-size: 2rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Bento Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
    padding-bottom: 50px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--accent-blue);
}

.card-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Phishing Module (Span 2 rows if needed) */
.module-phishing {
    /* grid-row: span 2; */
    /* Removing span 2 to let it auto-flow or just appear natural. Actually, keeping it as is or adjusting better. */
    grid-column: span 1;
    grid-row: span 2;
}

/* Stats and Training in right col */
.module-stats,
.module-training {
    grid-column: 2;
    /* auto row */
}

.email-simulator {
    background: rgba(255, 255, 255, 0.08);
    /* Slightly lighter glass */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.email-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.email-meta {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.email-meta .label {
    color: var(--text-muted);
    margin-right: 10px;
}

.email-body {
    padding: 20px;
    color: #e0e0e0;
}

.email-body p {
    margin-bottom: 15px;
}

.suspicious {
    border-bottom: 1px dashed rgba(255, 71, 87, 0.5);
    cursor: help;
    transition: background 0.2s;
}

.suspicious:hover {
    background: rgba(255, 71, 87, 0.1);
}

.btn-fake {
    background: #0070ba;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    margin-top: 10px;
}

.feedback-panel {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--accent-red);
    padding: 15px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.feedback-panel h3 {
    color: var(--accent-red);
    margin-bottom: 5px;
}

.btn-secondary-glass {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Password Lab */
.password-tester {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

.strength-meter-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    background: var(--accent-red);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.4s ease;
    box-shadow: 0 0 10px currentColor;
    /* Dynamic glow implemented via JS actually, but fallback here */
}

.strength-text {
    text-align: right;
    font-size: 0.85rem;
    font-weight: bold;
    min-height: 1.2em;
}

.password-tips li {
    list-style: none;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
    transition: color 0.3s;
}

.password-tips li::before {
    content: "○";
    position: absolute;
    left: 0;
    color: #555;
}

.password-tips li.valid {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
}

.password-tips li.valid::before {
    content: "●";
    color: var(--accent-green);
}

/* Hygiene Checklist */
.checklist-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checklist-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.checklist-item input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 4px;
    margin-right: 15px;
    position: relative;
    cursor: pointer;
}

.checklist-item input:checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: var(--glow-green);
}

.checklist-item input:checked::after {
    content: '✓';
    position: absolute;
    color: #000;
    font-size: 14px;
    top: -2px;
    left: 2px;
    font-weight: bold;
}

.checklist-item label {
    cursor: pointer;
    flex: 1;
}

.checklist-item label strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-main);
}

.checklist-item label span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checklist-item input:checked+label strong {
    text-decoration: line-through;
    color: #666;
}

/* Footer */
footer {
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    margin-top: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PHISHING ANALYZER MODULE
   ======================================== */

.module-analyzer {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .module-analyzer {
        grid-column: span 1;
    }
}

/* Tab Switcher */
.analyzer-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 102, 204, 0.2));
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

/* Analyzer Panels */
.analyzer-panel {
    animation: fadeIn 0.3s ease;
}

.analyzer-panel textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.analyzer-panel textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

/* Results Container */
.results-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.4s ease;
}

.risk-score-display {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    border: 4px solid var(--accent-green);
    background: rgba(0, 255, 200, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
    transition: all 0.5s ease;
}

.score-circle.low {
    border-color: var(--accent-green);
    background: rgba(0, 255, 200, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
}

.score-circle.medium {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
}

.score-circle.high {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.score-circle.critical {
    border-color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.risk-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Findings List */
.findings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finding-item {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid var(--accent-red);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.finding-item.critical {
    border-left-color: var(--accent-red);
}

.finding-item.high {
    border-left-color: #ff6b35;
}

.finding-item.medium {
    border-left-color: #ffc107;
}

.finding-item.low {
    border-left-color: var(--accent-blue);
}

.finding-icon {
    font-size: 1.2rem;
}

.finding-content {
    flex: 1;
}

.finding-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.finding-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   API CONFIGURATION MODULE
   ======================================== */

.api-config-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.api-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.api-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.api-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.api-icon {
    font-size: 1.5rem;
}

.api-info {
    flex: 1;
}

.api-info strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-main);
}

.api-status {
    font-size: 0.75rem;
    color: #888;
}

.api-status.active {
    color: var(--accent-green);
}

.api-status.error {
    color: var(--accent-red);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #666;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.slider {
    background: linear-gradient(135deg, var(--accent-green), #00cc99);
    box-shadow: var(--glow-green);
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(20px);
    background: white;
}

.toggle-switch input:disabled+.slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* API Key Input */
.api-key-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.api-key-input input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
}

.api-key-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-save-key {
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--accent-blue), #0066cc);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-key:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-blue);
}

.api-link {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-decoration: none;
    opacity: 0.8;
}

.api-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.api-note {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    text-align: center;
}

.api-note p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}
