/* Import Orbitron font for sci-fi feel */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;900&family=Inter:wght@400;500;600&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0e1a;
    color: #e1e8f0;
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

.analyzer-container {
    width: 100%;
    height: 550px;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
    border-radius: 12px;
    border: 1px solid #2a3441;
    box-shadow: 
        0 8px 32px rgba(15, 20, 25, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Sci-fi accents */
.analyzer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #39ff14, #00d4ff);
    animation: pulse-line 3s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.header {
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #1a1f2e 0%, #2a3441 100%);
    border-bottom: 1px solid #3a4553;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    background: linear-gradient(135deg, #00d4ff, #39ff14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header p {
    font-size: 0.85rem;
    color: #8892a6;
    margin: 0;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.input-pane {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: linear-gradient(180deg, #1a1f2e 0%, #141920 100%);
    border-right: 1px solid #2a3441;
    position: relative;
}

.input-pane::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, #00d4ff, transparent, #39ff14);
    opacity: 0.3;
}

.gauge-pane {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(180deg, #141920 0%, #0f1419 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow-y: auto;
    align-items: stretch;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #1a1f2e;
    border-bottom: 1px solid #2a3441;
    margin: 0;
    padding: 0;
    position: relative;
}

.tab-navigation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #00d4ff, #39ff14, #00d4ff);
    opacity: 0.3;
}

.tab-button {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: none;
    background: transparent;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8892a6;
    border-bottom: 2px solid transparent;
    position: relative;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #00d4ff00, #39ff1400);
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #e1e8f0;
    background: rgba(0, 212, 255, 0.05);
}

.tab-button:hover::before {
    background: linear-gradient(135deg, #00d4ff10, #39ff1410);
}

.tab-button.active {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.tab-button.active::before {
    background: linear-gradient(135deg, #00d4ff15, #39ff1415);
}

/* Form Elements */
.form-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(26, 31, 46, 0.3);
    border-radius: 8px;
    border: 1px solid #2a3441;
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #00d4ff, #39ff14);
    border-radius: 1px;
    opacity: 0.6;
}

.form-section h3 {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section-icon {
    width: 14px;
    height: 14px;
    color: #39ff14;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #b4c1d3;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #3a4553;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: #1a1f2e;
    color: #e1e8f0;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: #1e2530;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border: 1px solid #2a3441;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(26, 31, 46, 0.3);
    font-size: 0.8rem;
    position: relative;
}

.checkbox-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #00d4ff, #39ff14);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-item:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.checkbox-item:hover::before {
    opacity: 0.6;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.1);
    accent-color: #00d4ff;
}

.checkbox-item input[type="checkbox"]:checked + label {
    color: #00d4ff;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    color: #b4c1d3;
    transition: color 0.3s ease;
}

/* Advanced Risk Gauge */
.risk-gauge-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 1rem;
}

.risk-gauge {
    position: relative;
    width: 100%;
    height: 100%;
}

.gauge-background {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1f2e 60%, transparent);
    border: 2px solid #2a3441;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-135deg);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

.gauge-track {
    fill: none;
    stroke: #2a3441;
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: url(#glow);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.gauge-score {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 900;
    color: #e1e8f0;
    line-height: 1;
    text-shadow: 0 0 10px currentColor;
}

.gauge-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: #8892a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.risk-level-display {
    margin-top: 1rem;
    text-align: center;
}

.risk-level-label {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px currentColor;
}

.risk-level-label.low {
    color: #39ff14;
}

.risk-level-label.medium {
    color: #ffaa00;
}

.risk-level-label.high {
    color: #ff3344;
}

.risk-level-label.neutral {
    color: #00d4ff;
}

.risk-factors-list {
    background: rgba(26, 31, 46, 0.5);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    border: 1px solid #2a3441;
    max-height: 120px;
    overflow-y: auto;
}

.risk-factors-list h4 {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #00d4ff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-factors-list ul {
    list-style: none;
    padding: 0;
}

.risk-factors-list li {
    font-size: 0.75rem;
    color: #b4c1d3;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
    position: relative;
}

.risk-factors-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #39ff14;
}

/* Consultation Button - Results Tab Only */
.consultation-section {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    background: rgba(26, 31, 46, 0.3);
    border-radius: 8px;
    border: 1px solid #2a3441;
}

.consultation-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(180, 190, 200, 0.1);
    color: #b4c1d3;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #3a4553;
    cursor: pointer;
}

.consultation-btn:hover {
    background: rgba(180, 190, 200, 0.15);
    border-color: #4a5563;
    color: #e1e8f0;
    transform: translateY(-1px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1f2e;
}

::-webkit-scrollbar-thumb {
    background: #3a4553;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2a3441;
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-family: 'Orbitron', monospace;
    color: #8892a6;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced gamification animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes matrix-scan {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(500%); opacity: 0; }
}

/* Improved risk gauge styling */
.risk-gauge-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem auto;
}

/* Enhanced result cards with better visibility */
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--card-accent-color);
}

/* Gamification enhancements */
.gauge-pane .system-status {
    margin-top: auto;
    padding: 0.75rem;
    background: rgba(26, 31, 46, 0.3);
    border-radius: 8px;
    border: 1px solid #2a3441;
    text-align: center;
}

.system-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #39ff14;
    animation: pulse 2s infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Results Tab Styling */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.result-card {
    background: rgba(26, 31, 46, 0.6);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #2a3441;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--card-accent-color);
    border-radius: 2px;
}

.result-card.low {
    --card-accent-color: #39ff14;
}

.result-card.medium {
    --card-accent-color: #ffaa00;
}

.result-card.high {
    --card-accent-color: #ff3344;
}

.result-card:hover {
    border-color: var(--card-accent-color);
    background: rgba(26, 31, 46, 0.7);
}

.result-card h4 {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: #00d4ff;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-card p {
    font-size: 0.85rem;
    color: #e1e8f0;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Orbitron', monospace;
    backdrop-filter: blur(5px);
}

.status-indicator.allowed {
    background: rgba(57, 255, 20, 0.2);
    color: #39ff14;
    border: 1px solid #39ff14;
}

.status-indicator.restricted {
    background: rgba(255, 51, 68, 0.2);
    color: #ff3344;
    border: 1px solid #ff3344;
}

.status-indicator.requires-review {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .input-pane,
    .gauge-pane {
        flex: none;
        height: 250px;
    }
    
    .gauge-pane {
        padding: 0.5rem;
    }
    
    .risk-gauge-container {
        width: 150px;
        height: 150px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}