/* GenAI Security Framework Styles */

/* Variables - Cybersecurity Theme */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    margin: 0;
    padding: 0;
}

/* Header */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 5rem 0 2rem 0; /* Extra top padding to account for fixed navbar */
    margin-top: 0; /* No margin needed with fixed navbar */
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: securityScan 30s linear infinite;
}

@keyframes securityScan {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(60px) translateY(60px); }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    position: sticky;
    top: 59px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.nav-tabs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    min-height: 60px;
    align-items: center;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    color: var(--gray);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-tab span {
    font-size: 1.1rem;
    display: inline-block;
    line-height: 1;
}

.nav-tab:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

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

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section h2 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

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

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

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: var(--info);
}

.alert strong {
    font-weight: 700;
}

/* Assessment Grid */
.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.assessment-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.assessment-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    cursor: pointer;
}

/* Score Display */
.score-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.score-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.score-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.score-label {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
}

.score-value.critical {
    color: var(--danger);
}

.score-value.warning {
    color: var(--warning);
}

.score-value.success {
    color: var(--success);
}

/* Summary Section */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.summary-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.overall-score {
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 2rem 0;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    font-size: 0.95rem;
}

.breakdown-item span:first-child {
    color: var(--gray);
}

.breakdown-item span:last-child {
    font-weight: 600;
    color: var(--primary);
}

/* Risk Matrix */
.risk-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.risk-item {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.risk-item span:last-child {
    font-size: 1.5rem;
}

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

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

.low-risk {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

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

/* Recommendations */
.recommendations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    padding: 0.75rem;
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 0.95rem;
}

.recommendation-item.critical {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.recommendation-item.high {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary:hover {
    background: var(--dark);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .nav-tabs-container {
        padding: 0 1rem;
        overflow-x: auto;
    }
    
    .nav-tab {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .assessment-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .score-display {
        grid-template-columns: 1fr 1fr;
    }
    
    .overall-score {
        font-size: 3rem;
    }
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Print Styles */
@media print {
    .nav-tabs,
    .button-group,
    footer {
        display: none;
    }
    
    .header {
        margin-top: 0;
        page-break-after: avoid;
    }
    
    .section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}