/**
 * Cyber Security Monitoring Dashboard Styles
 * Dark Theme - Coalition Style
 */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #f8fafc;
    line-height: 1.6;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header */
.page-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 48px;
    width: auto;
}

.header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header-left p {
    font-size: 0.875rem;
    color: #94a3b8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-secondary {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.button-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.button-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.button-success:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.button-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.icon-button {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: #94a3b8;
    transition: all 0.2s;
}

.icon-button:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.tab.active {
    background: #3b82f6;
    color: white;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* Section Header */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Cards */
.card, .intro-card, .scan-form-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.card:hover {
    border-color: rgba(255,255,255,0.15);
}

/* Free Scan Container */
.free-scan-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .free-scan-container {
        grid-template-columns: 1fr;
    }
}

.free-scan-intro .intro-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.free-scan-intro .intro-card p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.scan-features {
    list-style: none;
    padding: 0;
}

.scan-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.scan-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 0.875rem;
    color: white;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.375rem;
}

.form-group select option {
    background: #1e293b;
    color: white;
}

.form-actions {
    margin-top: 1.5rem;
}

/* Scan Results */
.scan-results {
    margin-top: 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
}

.results-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

.scan-info {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.results-content {
    padding: 1.5rem;
}

/* Progress */
.scan-progress {
    text-align: center;
    padding: 2rem;
}

.progress-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.progress-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.progress-steps .step {
    font-size: 0.8125rem;
    color: #64748b;
    position: relative;
    padding-left: 1.25rem;
}

.progress-steps .step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border: 2px solid #64748b;
    border-radius: 50%;
}

.progress-steps .step.active {
    color: #3b82f6;
}

.progress-steps .step.active::before {
    background: #3b82f6;
    border-color: #3b82f6;
}

.progress-steps .step.complete {
    color: #22c55e;
}

.progress-steps .step.complete::before {
    background: #22c55e;
    border-color: #22c55e;
}

/* Security Score */
.security-score-display {
    text-align: center;
    padding: 2rem;
}

.score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255,255,255,0.05);
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #0f172a;
}

.score-value {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.score-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-circle.low { box-shadow: inset 0 0 0 8px #22c55e; }
.score-circle.medium { box-shadow: inset 0 0 0 8px #f59e0b; }
.score-circle.high { box-shadow: inset 0 0 0 8px #ef4444; }
.score-circle.critical { box-shadow: inset 0 0 0 8px #dc2626; }

/* Vulnerabilities Grid */
.vulnerabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.vulnerability-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem;
}

.vulnerability-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vulnerability-card p {
    font-size: 0.8125rem;
    color: #94a3b8;
    line-height: 1.5;
}

.severity-badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.severity-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.severity-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.severity-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Subscriptions Grid */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.subscription-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.subscription-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

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

.subscription-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

.subscription-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.subscription-status.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.subscription-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.subscription-domain {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    font-family: monospace;
}

.subscription-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.subscription-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.history-table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.history-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #60a5fa;
}

.service-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.service-card p {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

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

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Submit Spinner */
.submit-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
    }
    
    .container {
        padding: 1rem;
    }
    
    .tabs {
        justify-content: center;
    }
    
    .free-scan-container {
        grid-template-columns: 1fr;
    }
    
    .subscription-card {
        padding: 1rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
