/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 i {
    color: #667eea;
    font-size: 2.2rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.calculator-section,
.results-section,
.learning-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-header h2 i {
    color: #667eea;
}

.section-header p {
    color: #718096;
    font-size: 1rem;
}

/* Progress Bar */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 12.5%; /* 1/8 = 12.5% */
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

/* Question Container */
.question-container {
    position: relative;
    min-height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.question-screen {
    display: none;
    animation: fadeInSlide 0.5s ease-out;
}

.question-screen.active {
    display: block;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-header {
    text-align: center;
    margin-bottom: 40px;
}

.question-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.question-header h2 i {
    color: #667eea;
    font-size: 1.8rem;
}

.question-header p {
    font-size: 1.1rem;
    color: #718096;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Question Options */
.question-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.option-card {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.option-card:hover::before {
    left: 100%;
}

.option-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.option-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.option-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.option-card:hover .option-icon {
    transform: scale(1.1);
}

.option-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.option-description {
    font-size: 0.95rem;
    color: #718096;
    line-height: 1.5;
}

/* Question Navigation */
.question-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.nav-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #a0aec0;
}

.nav-btn:not(:disabled):hover {
    transform: translateY(-2px);
}

.prev-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.prev-btn:not(:disabled):hover {
    background: #cbd5e0;
}

.next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.next-btn:not(:disabled):hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.calculate-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.calculate-btn:hover {
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.example-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.3) !important;
    margin-left: 20px !important;
    margin-right: 0 !important;
}

.example-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4) !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.calculate-btn,
.reset-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.reset-btn:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* Results Section */
.score-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.base-score {
    text-align: center;
    padding: 40px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 3px solid #e2e8f0;
    transition: all 0.3s ease;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.base-score:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.base-score h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2d3748;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-severity {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* Severity Colors */
.severity-low {
    background: #c6f6d5;
    color: #22543d;
}

.severity-medium {
    background: #fef5e7;
    color: #744210;
}

.severity-high {
    background: #fed7d7;
    color: #742a2a;
}

.severity-critical {
    background: #fbb6ce;
    color: #702459;
}

/* Vector String */
.vector-string {
    margin-bottom: 30px;
}

.vector-string h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.vector-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    margin-bottom: 10px;
    position: relative;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Calculation Breakdown */
.calculation-breakdown {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.calculation-breakdown h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.breakdown-step {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breakdown-step:last-child {
    margin-bottom: 0;
}

.breakdown-step h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.breakdown-step p {
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

/* Learning Section */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 20px;
}

.info-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.info-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card h3 i {
    color: #667eea;
}

.info-card p {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 15px;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 0.95rem;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li span {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .calculator-section,
    .results-section,
    .learning-section {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .score-display {
        grid-template-columns: 1fr;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .vector-display {
        font-size: 0.8rem;
    }
}

/* Animation for results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #2d3748;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error states */
.success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #9ae6b4;
}

.error {
    background: #fed7d7;
    color: #742a2a;
    border-color: #feb2b2;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .header,
    .calculator-section,
    .learning-section {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .form-actions {
        display: none;
    }
}
