/* Digital Systems Risk Analyzer - Frontend Styles */

:root {
    --dsra-bg: #0b0d12;
    --dsra-text: #e6e9f0;
    --dsra-muted: #9aa0b2;
    --dsra-silver: #f3f4f6;
    --dsra-border: rgba(255,255,255,.08);
}

/* Container */
.dsra-analyzer-container {
    position: relative;
    max-width: 1200px;
    margin: 40px auto;
    padding: 60px 24px;
    background: 
        radial-gradient(900px 500px at 80% -10%, rgba(199,202,214,.18), transparent),
        radial-gradient(800px 450px at -10% 20%, rgba(139,144,163,.12), transparent),
        var(--dsra-bg);
    border-radius: 20px;
    color: var(--dsra-text);
    min-height: 600px;
}

#dsra-canvas {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
}

/* Hero Section */
.dsra-hero {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin-bottom: 50px;
}

.dsra-main-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 20px 0;
    font-weight: 700;
    background: linear-gradient(135deg, #f3f4f6, #c7cad6, #8b90a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dsra-subtitle {
    font-size: 1.1rem;
    color: var(--dsra-muted);
    line-height: 1.7;
    margin: 0;
}

/* Panel */
.dsra-panel {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid var(--dsra-border);
    border-radius: 24px;
    padding: 50px;
    backdrop-filter: blur(10px);
}

/* Form */
.dsra-form {
    max-width: 100%;
}

.dsra-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.dsra-field {
    margin-bottom: 20px;
}

.dsra-field label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dsra-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.dsra-field input,
.dsra-field select {
    width: 100%;
    background: #0e1119;
    border: 1px solid var(--dsra-border);
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--dsra-text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.dsra-field input:focus,
.dsra-field select:focus {
    outline: none;
    border-color: #8b90a3;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05);
}

.dsra-field select option {
    background: #0e1119;
    color: var(--dsra-text);
}

/* Button */
.dsra-btn-primary {
    width: 100%;
    padding: 18px 32px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    color: #0b0d12;
    background: linear-gradient(135deg, #f3f4f6, #c7cad6, #8b90a3);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255,255,255,.2);
    margin-top: 10px;
}

.dsra-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255,255,255,.3);
}

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

.dsra-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dsra-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(11,13,18,.3);
    border-top-color: #0b0d12;
    border-radius: 50%;
    animation: dsra-spin 0.8s linear infinite;
}

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

/* Result */
.dsra-result {
    margin-top: 50px;
    animation: dsra-fadeIn 0.5s;
}

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

.dsra-result-header {
    text-align: center;
    margin-bottom: 30px;
}

.dsra-score-box {
    display: inline-block;
}

.dsra-score {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #f3f4f6, #c7cad6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dsra-score-label {
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dsra-muted);
    margin-top: 8px;
}

.dsra-result-content {
    background: #0e1119;
    border: 1px solid var(--dsra-border);
    padding: 40px;
    border-radius: 20px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Risk Level Colors */
.dsra-result.dsra-critical .dsra-score {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dsra-result.dsra-high .dsra-score {
    background: linear-gradient(135deg, #ff8800, #ff6600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dsra-result.dsra-medium .dsra-score {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dsra-result.dsra-low .dsra-score {
    background: linear-gradient(135deg, #00cc88, #00aa66);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mobile */
@media (max-width: 768px) {
    .dsra-analyzer-container {
        margin: 20px;
        padding: 40px 20px;
    }
    
    .dsra-panel {
        padding: 30px 20px;
    }
    
    .dsra-form-row {
        grid-template-columns: 1fr;
    }
    
    .dsra-result-content {
        padding: 25px 20px;
    }
}
