
/**
 * MCQs Exam Creator Styles
 * 
 * @package MCQS_Exam_Creator
 * @since 1.0.0
 */

:root {
    --primary: #00E785;
    --secondary: #4FC3FF;
    --accent: #FFE96E;
    --purple: #F9B4FF;
    --dark: #1D1D1D;
    --white: #FFFFFF;
    --light-green: #CAFDE8;
    --light-blue: #E3F5FF;
    --light-yellow: #FFF6DA;
    --light-purple: #FDECFF;
    --container-width: 1000px;
    --section-padding: 2rem;
}

/* Base Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
}

.app-container {
    max-width: var(--container-width);
    margin: 2rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: var(--white);
}

/* Header Styles */
.app-header {
    background: var(--dark);
    color: var(--white);
    padding: var(--section-padding);
    text-align: center;
}

.app-title {
    font-size: 1.8rem;
    margin: 0 0 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
}

/* Form Container */
.form-container {
    padding: var(--section-padding);
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Form Elements */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    display: block;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 231, 133, 0.2);
    outline: none;
}

/* Buttons */
.btn {
    padding: 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
}

.btn-primary:hover {
    background: #00cf7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 231, 133, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #3ab2ec;
    box-shadow: 0 4px 12px rgba(79, 195, 255, 0.3);
}

.btn-accent {
    background: var(--accent);
    color: var(--dark);
}

.btn-accent:hover {
    background: #f5df5e;
    box-shadow: 0 4px 12px rgba(255, 233, 110, 0.3);
}

.btn-purple {
    background: var(--purple);
    color: var(--dark);
}

.btn-purple:hover {
    background: #f0a1f5;
    box-shadow: 0 4px 12px rgba(249, 180, 255, 0.3);
}

.btn-dark {
    background: var(--dark);
    color: var(--white);
}

.btn-dark:hover {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(29, 29, 29, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
}

/* Loading Spinner */
#loading-spinner {
    display: none !important;
    text-align: center;
    opacity: 0 !important;
    visibility: hidden !important;
    position: relative;
    z-index: 1000;
    transition: opacity 0.5s ease-in-out !important;
}

#loading-spinner.visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.loading-animation {
    width: 70px;
    height: 70px;
    margin: 2rem auto;
    position: relative;
    transform-origin: center;
    animation: container-rotate 2.5s linear infinite;
}

.loading-animation .circle {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: rotate(45deg);
    animation: orbit 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-animation .circle::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: scale(1);
}

.loading-animation .circle:nth-child(1)::after {
    background: var(--primary) !important;
    box-shadow: 0 0 15px var(--primary) !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.loading-animation .circle:nth-child(2)::after {
    background: var(--secondary) !important;
    box-shadow: 0 0 15px var(--secondary) !important;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.loading-animation .circle:nth-child(3)::after {
    background: var(--accent) !important;
    box-shadow: 0 0 15px var(--accent) !important;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.loading-animation .circle:nth-child(4)::after {
    background: var(--purple) !important;
    box-shadow: 0 0 15px var(--purple) !important;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.loading-animation .circle:nth-child(1) { animation-delay: 0s; }
.loading-animation .circle:nth-child(2) { animation-delay: 0.5s; }
.loading-animation .circle:nth-child(3) { animation-delay: 1s; }
.loading-animation .circle:nth-child(4) { animation-delay: 1.5s; }

@keyframes orbit {
    0% {
        transform: rotate(45deg);
        opacity: 1;
    }
    70% {
        opacity: 1;
        transform: rotate(315deg);
    }
    100% {
        transform: rotate(405deg);
        opacity: 0;
    }
}

@keyframes container-rotate {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    text-align: center;
    font-weight: 600;
    color: var(--dark) !important;
    margin-top: 1.5rem;
    font-size: 1.2rem;
    animation: text-pulse 1.5s ease-in-out infinite;
}

@keyframes text-pulse {
    0%, 100% { 
        opacity: 1 !important; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8 !important; 
        transform: scale(0.98); 
    }
}

/* Question Cards */
.question-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary);
}

.question-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.question-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #4a5568;
}

/* Answer Options */
.answer-option {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.answer-option:hover {
    transform: translateX(5px);
    background-color: #f8f9fa;
}

.correct-answer {
    background-color: var(--light-green);
    border-color: var(--primary);
    color: #065f46;
    font-weight: 600;
}

.correct-answer:hover {
    background-color: #b3f6d8;
}

.correct-mark {
    margin-left: auto;
    color: var(--primary);
    font-size: 1.25rem;
}

/* Explanation */
.explanation-container {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.toggle-explanation {
    background: var(--light-blue);
    color: var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.toggle-explanation:hover {
    background: #d0ecff;
}

.explanation {
    background: var(--light-blue);
    padding: 1rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
}

/* Action Buttons */
#action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: center;
    width: 100%;
}

#action-buttons .btn {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 300px;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#action-buttons #new-quiz {
    background-color: var(--light-yellow);
    color: var(--dark);
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-selector select {
    appearance: none;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
}

.lang-selector::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--dark);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-red-500 {
    color: #ef4444;
}

.font-semibold {
    font-weight: 600;
}

.p-6 {
    padding: 1.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.w-full {
    width: 100%;
}

.options-container > * + * {
    margin-top: 0.5rem;
}

/* Print Styles */
@media print {
    .app-header,
    form,
    #action-buttons,
    #loading-spinner,
    #error-message,
    .toggle-explanation {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .correct-answer {
        background-color: transparent !important;
        border-color: #e5e7eb !important;
        color: black !important;
        font-weight: normal !important;
    }
    
    .correct-mark {
        display: none !important;
    }
    
    .explanation {
        display: none !important;
    }
    
    .print-option {
        border: none !important;
        padding-left: 0 !important;
        background-color: transparent !important;
    }
    
    .question-card {
        border-left: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        margin: 1rem;
        border-radius: 8px;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    #action-buttons {
        flex-direction: column;
    }
    
    #action-buttons .btn {
        width: 100%;
        max-width: 100%;
        min-width: unset;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #action-buttons .btn {
        min-width: 180px;
        flex: 1 1 180px;
    }
}

/* Popup Styles for Language Warning */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
    padding: 20px;
}

.popup-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 460px;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.animated-popup {
    animation: popup-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-enter {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popup-exit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #f8f9fa;
}

.popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-title i {
    color: #e74c3c;
    font-size: 20px;
}

.popup-title h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.close-popup {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.close-popup:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

.popup-body {
    padding: 25px;
    text-align: center;
}

.illustration {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
}

.illustration .fa-file-pdf {
    font-size: 70px;
    color: #e74c3c;
    position: absolute;
    top: 0;
    left: 20px;
}

.language-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: #3498db;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cross-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(231, 76, 60, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.main-message {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.sub-message {
    color: #7f8c8d;
    margin-bottom: 12px;
}

.supported-languages {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.language-pill {
    background-color: #3498db;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.language-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.action-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    border-left: 4px solid #3498db;
    margin-top: 15px;
}

.action-info i {
    color: #3498db;
    font-size: 18px;
    margin-top: 2px;
}

.action-info p {
    margin: 0;
    color: #34495e;
    font-size: 14px;
    line-height: 1.5;
}

.popup-footer {
    padding: 18px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #f8f9fa;
}

.doc-download-btn,
.close-popup-btn {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.doc-download-btn {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.doc-download-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.close-popup-btn {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.close-popup-btn:hover {
    background-color: #e0e6e8;
    color: #34495e;
}

/* Responsive Popup */
@media (max-width: 500px) {
    .popup-content {
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .popup-header,
    .popup-footer {
        padding: 15px;
    }
    
    .popup-body {
        padding: 20px 15px;
    }
    
    .language-pill {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .doc-download-btn,
    .close-popup-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .main-message {
        font-size: 16px;
    }
    
    .sub-message,
    .action-info p {
        font-size: 13px;
    }
}
