/* Exam Simulators - Professional Certification Portal Styles */
/* Based on CPE Pipelines Portal Design */

/* SVG Grain Filter */
.grain-filter {
    position: relative;
    overflow: hidden;
}
.grain-filter::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="1.2" numOctaves="5" /></filter><rect width="300" height="300" filter="url(%23noise)" opacity="0.8" /></svg>');
    border-radius: 1rem;
    opacity: 0.35;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%) !important;
}

.light-theme .glass {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-theme .glass-dark {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-theme h1, .light-theme h2, .light-theme h3, .light-theme p, .light-theme span, .light-theme label {
    color: #1e293b !important;
}

.light-theme input, .light-theme select, .light-theme textarea {
    color: #1e293b !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.metallic {
    background: linear-gradient(145deg, #2d3748, #1a202c);
    box-shadow: 20px 20px 60px #0f1419, -20px -20px 60px #374151;
}

.gradient-border {
    background: linear-gradient(45deg, #003f7f, #0066cc, #ffb81c, #003f7f);
    background-size: 400% 400%;
    animation: gradient-xy 6s ease infinite;
}

.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    animation: float 8s ease-in-out infinite;
}

.orb-1 {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #0a4b8e, #1e90ff);
    top: 15%;
    left: 15%;
    animation: drift 15s ease-in-out infinite, fade-pulse 10s ease-in-out infinite;
    animation-delay: 0s;
}

.orb-2 {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #1e90ff, #4da6ff);
    top: 65%;
    right: 20%;
    animation: drift 18s ease-in-out infinite reverse, fade-pulse 12s ease-in-out infinite;
    animation-delay: 3s;
}

.orb-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #0a4b8e, #1e90ff);
    bottom: 25%;
    left: 60%;
    animation: drift 20s ease-in-out infinite, fade-pulse 14s ease-in-out infinite;
    animation-delay: 6s;
}

.orb-4 {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #1e90ff, #4da6ff);
    top: 40%;
    left: 80%;
    animation: drift 16s ease-in-out infinite reverse, fade-pulse 9s ease-in-out infinite;
    animation-delay: 8s;
}

.orb-5 {
    width: 90px;
    height: 90px;
    background: linear-gradient(45deg, #0a4b8e, #1e90ff);
    top: 80%;
    left: 25%;
    animation: drift 22s ease-in-out infinite, fade-pulse 11s ease-in-out infinite;
    animation-delay: 12s;
}

.input-glow:focus {
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.3);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.massively-heading {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 900;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    line-height: 1.5;
}

.massively-body {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 300;
    line-height: 2.375;
}

.massively-button {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 900;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    border: 2px solid;
    transition: all 0.2s ease-in-out;
    padding: 0.75rem 2rem;
    font-size: 0.8rem;
    line-height: 1;
}

.massively-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.massively-input {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease-in-out;
}

.massively-input:focus {
    border-color: #1e90ff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

/* Exam Card Styling */
.exam-card {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.04),
        0 10px 20px rgba(0, 0, 0, 0.6),
        0 6px 6px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(255,255,255,0.04);
}

.exam-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.5rem;
    pointer-events: none;
    z-index: 2;
}

.exam-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(40px);
    opacity: 0.3;
    z-index: -1;
    border-radius: 1.5rem;
}

.exam-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 12px 12px rgba(0, 0, 0, 0.3),
        inset 0 -3px 8px rgba(0, 0, 0, 0.25);
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

/* Question and Answer Styling */
.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    user-select: none;
    color: white;
}

.answer-list {
    padding: 0;
    margin: 0;
}

.answer-list li {
    margin-bottom: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
}

.answer-list li:hover {
    border-color: #1e90ff;
    background-color: rgba(30, 144, 255, 0.1);
}

.answer-list li.selected {
    border-color: #1e90ff;
    background-color: rgba(30, 144, 255, 0.2);
}

.answer-list li.correct {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

.answer-list li.incorrect {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.toggle-button {
    display: flex;
    align-items: center;
    padding: 1rem;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    color: white;
    user-select: none;
}

.toggle-button:hover {
    text-decoration: none;
    color: white;
}

.choice-radio {
    display: none;
}

.choice-text {
    flex: 1;
    margin-left: 1rem;
    color: white;
}

.answer-label {
    font-weight: bold;
    min-width: 2rem;
    color: white;
}

/* Explanation Card */
.explanation-card {
    max-width: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: white;
}

#explanation-text {
    line-height: 1.6;
    color: white;
}

#explanation-text ol {
    padding-left: 1.5rem;
}

#references {
    font-size: 0.9rem;
    color: #d1d5db;
}

#references a {
    color: #60a5fa;
}

/* Progress Bar */
.progress {
    height: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: linear-gradient(45deg, #0a4b8e, #1e90ff);
    border-radius: 1rem;
    color: white;
}

/* Score Summary */
.display-4 {
    font-weight: bold;
}

.text-primary {
    color: #60a5fa !important;
}

/* Domain Scores */
.domain-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.domain-score:last-child {
    border-bottom: none;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Results Page Styling */
.results-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    color: white;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(from 0deg, #1e90ff 0%, #1e90ff var(--score-percentage), rgba(255,255,255,0.1) var(--score-percentage), rgba(255,255,255,0.1) 100%);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001122 0%, #002244 50%, #001122 100%);
}

.score-text {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Domain Performance Cards */
.domain-performance-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.domain-performance-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.performance-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e90ff, #4da6ff);
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .toggle-button {
        padding: 0.75rem;
    }
    
    .choice-text {
        margin-left: 0.75rem;
    }
    
    .glass {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .exam-card {
        margin: 0.5rem 0;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
}

/* Animation for theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

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

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

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .glass, .glass-dark {
        border: 1px solid #000 !important;
        background-color: white !important;
    }
    
    .question-text, .choice-text, .answer-label {
        color: black !important;
    }
}