/* cfscanner - Infrastructure Scanner Styles */

:root {
    --cf-orange: #F6821F;
    --cf-orange-light: #FBAD41;
    --cf-dark: #1d1d1d;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-light);
}

/* ==================== COMMON ==================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cf-orange), var(--cf-orange-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(246, 130, 31, 0.3);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.hidden {
    display: none !important;
}

/* ==================== GMAIL LAYOUT ==================== */

.gmail-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gmail-layout .navbar {
    flex-shrink: 0;
}

.gmail-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-actions {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.domain-list {
    flex: 1;
    overflow-y: auto;
}

.domain-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
}

.domain-item:hover {
    background: var(--bg-light);
}

.domain-item.active {
    background: rgba(246, 130, 31, 0.1);
    border-left: 3px solid var(--cf-orange);
}

.domain-name {
    font-weight: 500;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.domain-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.subdomain-badge {
    background: var(--cf-orange);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

.not-scanned {
    color: var(--text-secondary);
    font-style: italic;
}

.empty-sidebar {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.domain-title h2 {
    font-size: 1.5rem;
    color: var(--cf-orange);
}

.domain-title .company-name {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.domain-actions {
    display: flex;
    gap: 0.5rem;
}

/* Infrastructure Summary */
.infra-summary {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.infra-summary h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.infra-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.infra-chip {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid var(--cf-orange);
}

.chip-category {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip-vendor {
    font-weight: 600;
    font-size: 0.9375rem;
}

.chip-cf {
    font-size: 0.75rem;
    color: var(--cf-orange);
    margin-top: 0.25rem;
}

/* Subdomains Section */
.subdomains-section {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subdomains-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.subdomain-list {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.subdomain-item {
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.subdomain-item:last-child {
    border-bottom: none;
}

.subdomain-item:hover {
    background: var(--bg-light);
}

.subdomain-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.subdomain-name {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
}

.subdomain-vendor {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: rgba(246, 130, 31, 0.1);
    color: var(--cf-orange);
    border-radius: 4px;
}

.expand-icon {
    width: 1.5rem;
    text-align: center;
    font-weight: bold;
    color: var(--text-secondary);
}

.subdomain-details {
    padding: 0.75rem 1rem 1rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    font-family: monospace;
}

.report-link {
    margin-top: 1.5rem;
    text-align: center;
}

/* Empty States */
.empty-state-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-large h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal form input[type="text"],
.modal form input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal form input[type="text"]:focus {
    outline: none;
    border-color: var(--cf-orange);
}

.import-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.import-options label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ==================== NAVBAR ==================== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cf-orange);
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

/* ==================== LANDING PAGE ==================== */

.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cf-dark) 0%, #2d2d2d 100%);
}

.landing-container {
    text-align: center;
    max-width: 600px;
    padding: 3rem;
}

.landing-header h1 {
    font-size: 3rem;
    color: var(--cf-orange);
    margin-bottom: 0.5rem;
}

.tagline {
    color: #9ca3af;
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d1d5db;
}

.feature-icon {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(246, 130, 31, 0.2);
    color: var(--cf-orange);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.description {
    color: #9ca3af;
    margin-bottom: 2rem;
}

.landing-footer {
    margin-top: 3rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.small {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ==================== DASHBOARD ==================== */

.scan-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.scan-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.scan-form .input-group {
    display: flex;
    gap: 1rem;
}

.scan-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.scan-form input:focus {
    outline: none;
    border-color: var(--cf-orange);
}

/* Scan Progress */

.scan-progress {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cf-orange), var(--cf-orange-light));
    transition: width 0.3s ease;
}

.progress-details {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.progress-detail {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.finding-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(246, 130, 31, 0.1);
    color: var(--cf-orange);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Scans List */

.scans-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.scans-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.scans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scan-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    gap: 1rem;
}

.scan-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scan-domain {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.scan-domain:hover {
    color: var(--cf-orange);
}

.scan-company {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.scan-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.scan-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-scanning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-pending {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.scan-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ==================== REPORT ==================== */

.report-container {
    max-width: 900px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.report-title h1 {
    font-size: 2rem;
    color: var(--cf-orange);
}

.company-name {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.report-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.report-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Summary Grid */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.summary-vendor {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-opportunity {
    font-size: 0.875rem;
    color: var(--cf-orange);
}

.summary-none {
    color: var(--text-secondary);
    font-style: italic;
}

/* Opportunities */

.opportunities-section {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 2px solid var(--cf-orange-light);
}

.opportunities-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.opportunity-card {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--cf-orange);
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.opportunity-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cf-orange);
}

.opportunity-current {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.opportunity-product {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.opportunity-pitch {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.opportunity-evidence {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Results Grid */

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.result-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-item h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-item ul {
    list-style: none;
    font-size: 0.875rem;
}

.result-item li {
    padding: 0.25rem 0;
}

.txt-records li {
    font-family: monospace;
    font-size: 0.75rem;
    word-break: break-all;
    background: white;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
}

/* Security Headers */

.security-headers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.header-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.header-item.present {
    background: rgba(16, 185, 129, 0.1);
}

.header-item.missing {
    background: rgba(239, 68, 68, 0.1);
}

.header-name {
    font-weight: 500;
}

.header-item.present .header-status {
    color: var(--success);
}

.header-item.missing .header-status {
    color: var(--danger);
}

/* Email Security */

.email-security-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.email-check {
    padding: 1.5rem;
    text-align: center;
    border-radius: 8px;
}

.email-check.valid {
    background: rgba(16, 185, 129, 0.1);
}

.email-check.invalid {
    background: rgba(239, 68, 68, 0.1);
}

.check-name {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.email-check.valid .check-name {
    color: var(--success);
}

.email-check.invalid .check-name {
    color: var(--danger);
}

.check-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.check-detail {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Subdomains Table */

.subdomains-table {
    overflow-x: auto;
}

.subdomains-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.subdomains-table th,
.subdomains-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.subdomains-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.more-note {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Tech List */

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.375rem 0.75rem;
    background: var(--bg-light);
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* AI Research */

.ai-research {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.ai-research ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.ai-research li {
    margin-bottom: 0.5rem;
}

/* SAN List */

.san-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.san-list li {
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

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

    .scan-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .scan-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .report-header {
        flex-direction: column;
        gap: 1rem;
    }

    .report-meta {
        align-items: flex-start;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }

    .email-security-grid {
        grid-template-columns: 1fr;
    }
}
