/* === OSINT Platform - Light Theme (matching newsletter) === */

:root {
    --bg-primary: #eef0f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fc;
    --border: #e5e9f2;
    --border-focus: #3b82f6;
    --text-primary: #374151;
    --text-secondary: #9ca3af;
    --text-heading: #111827;
    --blue: #2563eb;
    --blue-dark: #1a3a7a;
    --blue-light: #eff6ff;
    --blue-border: #bfdbfe;
    --green: #16a34a;
    --green-bright: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --font-heading: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 6px;
    --shadow-card: 0 2px 16px rgba(15, 30, 70, 0.10);
    --footer-bg: #f0f2f7;
    --footer-border: #e0e4ed;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--blue);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* === Container === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, #0f2557 0%, #1a3a7a 60%, #1e4494 100%);
    border-bottom: none;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(15, 30, 70, 0.15);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-img {
    height: 32px;
    width: auto;
}
.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
}
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-link {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}
.nav-link--logout {
    color: rgba(255, 255, 255, 0.5);
}
.nav-link--logout:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
}

/* === Main === */
.main {
    flex: 1;
    padding: 30px 0;
}

/* === Footer === */
.footer {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
}

/* === Card === */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.card-body {
    padding: 24px;
}

/* === Terminal Header (repurposed as card header) === */
.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0f2557 0%, #1a3a7a 60%, #1e4494 100%);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.terminal-dot {
    display: none;
}
.terminal-dot--red { background: #ff5f57; }
.terminal-dot--yellow { background: #febc2e; }
.terminal-dot--green { background: #28c840; }
.terminal-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-left: 0;
    letter-spacing: 0.5px;
}
.terminal-text {
    font-family: var(--font-heading);
    color: var(--blue-dark);
    font-weight: 700;
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}
.alert--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.alert--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.alert--info {
    background: var(--blue-light);
    border-color: var(--blue-border);
    color: #1e40af;
}

/* === Forms === */
.form { margin-top: 20px; }
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-input--code {
    font-size: 28px;
    text-align: center;
    letter-spacing: 8px;
    padding: 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--blue-dark);
}
.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    font-family: var(--font-sans);
}
.btn:hover {
    background: var(--border);
    text-decoration: none;
}
.btn--primary {
    background: linear-gradient(135deg, #1a3a7a, #2563eb);
    border-color: transparent;
    color: #fff;
}
.btn--primary:hover {
    background: linear-gradient(135deg, #0f2557, #1a3a7a);
}
.btn--full {
    width: 100%;
    display: block;
}

/* === Auth pages === */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    gap: 20px;
}
.auth-logo {
    text-align: center;
}
.auth-logo .logo-img {
    height: 64px;
    width: auto;
}
.auth-card {
    width: 100%;
    max-width: 500px;
}
.auth-title {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--blue-dark);
    margin-bottom: 20px;
    text-align: center;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-info {
    max-width: 500px;
    text-align: center;
    background: var(--blue-light);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--blue-border);
}
.auth-info h3 {
    font-size: 16px;
    font-family: var(--font-heading);
    color: var(--blue-dark);
    margin-bottom: 8px;
}
.auth-info p {
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}
.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

/* === Page header === */
.page-header {
    margin-bottom: 24px;
}
.page-header .link {
    font-size: 13px;
    display: inline-block;
    margin-bottom: 8px;
}
.page-header h1 {
    font-size: 22px;
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-bottom: 6px;
}
.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

/* === Section heading === */
.section-heading {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--blue-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Badges === */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.badge--info {
    background: var(--blue-light);
    color: #1e40af;
    border: 1px solid var(--blue-border);
}
.badge--pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* === Courses grid === */
.courses-grid {
    display: grid;
    gap: 16px;
}
.course-card {
    padding: 24px;
}
.course-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.course-title {
    font-size: 18px;
    font-family: var(--font-heading);
    color: var(--text-heading);
}
.course-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.course-progress {
    flex: 1;
}

/* === Progress bar === */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.progress-bar--large {
    height: 8px;
    margin-bottom: 10px;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a3a7a, #3b82f6);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 0;
}
.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === Course stats === */
.course-stats {
    margin-bottom: 20px;
}

/* === Task list === */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-card-status {
    margin-right: 16px;
    flex-shrink: 0;
}
.task-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}
.task-check--done {
    background: linear-gradient(135deg, #1a3a7a, #2563eb);
    color: #fff;
}
.task-check--pending {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.task-card-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.task-card-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-heading);
}

/* === Task accordion === */
.task-accordion {
    transition: border-color 0.2s;
}
.task-accordion--solved {
    border-color: #3b82f6;
}
.task-accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.task-accordion-header:hover {
    background: var(--bg-tertiary);
}
.task-accordion-arrow {
    color: var(--text-secondary);
    font-size: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}
.task-accordion-arrow--open {
    transform: rotate(180deg);
}
.task-accordion-body {
    display: none;
}
.task-accordion-body--open {
    display: block;
}
.task-accordion-inner {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* === Task description === */
.task-description {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-secondary);
}
.task-description p { margin-bottom: 8px; }
.task-description p:last-child { margin-bottom: 0; }
.task-description strong, .task-description b { color: var(--text-heading); }
.task-description ul, .task-description ol { margin: 8px 0; padding-left: 24px; }
.task-description li { margin-bottom: 4px; }
.task-description a { color: var(--blue); }
.task-description img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 8px 0; }
.task-description h2, .task-description h3 { color: var(--text-heading); margin: 12px 0 6px; }
.task-description blockquote {
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}

/* === Course description (rich text) === */
.course-desc p { margin-bottom: 4px; }
.course-desc p:last-child { margin-bottom: 0; }
.course-desc img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* === Task inline form === */
.task-inline-form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.task-inline-form-row .form-input {
    flex: 1;
    min-width: 0;
}
.task-inline-form-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* === Task solved inline === */
.task-solved-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #166534;
    font-weight: 600;
    font-size: 14px;
}
.task-solved-icon-sm {
    font-size: 20px;
}

/* === Opinion form & star rating === */
.opinion-card .card-body {
    padding: 24px 28px 28px;
}

.opinion-form textarea {
    margin-top: 0;
    width: 100%;
    resize: vertical;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 16px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}

.star-rating label:hover {
    transform: scale(1.1);
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #f59e0b;
}

/* === Certificate (HTML fallback) === */
.certificate-page {
    padding: 20px 0;
}
.certificate-frame {
    background: var(--bg-primary);
    border: 2px solid var(--blue);
    border-radius: var(--radius);
    padding: 8px;
    max-width: 700px;
    margin: 0 auto;
}
.certificate-border {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.certificate-inner {
    padding: 40px 30px;
    text-align: center;
}
.certificate-logo {
    height: 50px;
    margin-bottom: 20px;
}
.certificate-heading {
    font-size: 16px;
    color: var(--blue);
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.certificate-course {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.certificate-separator {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 60px;
}
.certificate-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.certificate-name {
    font-size: 28px;
    color: var(--blue);
    font-weight: 700;
    margin: 10px 0 20px;
}
.certificate-date {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.certificate-verify {
    font-size: 10px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* === Print styles for certificate === */
@media print {
    body { background: #0d1117 !important; }
    .header, .footer, .btn, .nav { display: none !important; }
    .main { padding: 0; }
    .container { max-width: none; padding: 0; }
    .certificate-frame {
        border: 2px solid #58a6ff;
        max-width: none;
    }
}

/* === Responsive === */
@media (max-width: 600px) {
    .header-inner { flex-wrap: wrap; gap: 8px; }
    .nav { width: 100%; justify-content: flex-end; }
    .course-card-footer { flex-direction: column; align-items: stretch; }
    .task-card-content { flex-direction: column; align-items: flex-start; gap: 4px; }
    .task-inline-form-row { flex-direction: column; }
    .certificate-inner { padding: 24px 16px; }
    .certificate-name { font-size: 22px; }
    .form-input--code { font-size: 22px; letter-spacing: 5px; }
}
