/* ExamStatistic Component Styles */
/* Navigation Cards for Practice Exams */

/* Container */
.exam-statistic-container {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 100%; /* Ensure full height */
    min-height: 120px; /* Minimum height for consistency */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth transitions */
}

.exam-statistic-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.exam-statistic-container:active {
    transform: translateY(-1px) scale(0.98);
}

/* Content Area */
.exam-statistic-content {
    flex-grow: 1;
    height: 100%;
    min-height: 120px; /* Match container min-height */
    border-radius: 1rem;
    padding: 1.5rem;
    margin-left: 1.5rem;
    display: flex;
    align-items: center;
}

/* Icon Container */
.exam-statistic-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    position: absolute;
    left: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.exam-statistic-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* Text Content */
.exam-statistic-text {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    text-align: left;
}

.exam-statistic-title {
    font-size: var(--edtt-font-size-lg);
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    line-height: 1.25;
    letter-spacing: -0.025em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.exam-statistic-subtitle {
    font-size: var(--edtt-font-size-sm);
    opacity: 0.8;
    line-height: 1.25;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.025em;
    /* Ensure text doesn't overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Prevent text from being too long */
    max-width: 100%;
}

/* Hover Effect Overlay */
.exam-statistic-overlay {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading State */
.exam-statistic-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10;
    border-radius: 1rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--edtt-color-primary, #ea4c89);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Disabled State */
.exam-statistic-container[data-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Navigation Cards Section */
.navigation-cards-section {
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}


.navigation-cards-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.navigation-cards-section .section-title {
    font-size: var(--edtt-font-size-2xl);
    font-weight: 500;
    color: var(--edtt-color-black);
    margin-bottom: 0.75rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.navigation-cards-section .section-description {
    font-size: var(--edtt-font-size-sm);
    color: var(--edtt-color-gray-100);
    text-align: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Entrance Animations */
.exam-stat-featured,
.exam-stat-popular,
.exam-stat-collections,
.exam-stat-all {
    animation: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.exam-statistic-container[role="button"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.exam-statistic-container[tabindex="0"]:focus-visible {
    outline: 2px solid var(--edtt-color-primary, #ea4c89);
    outline-offset: 3px;
}

/* Theme Variations */
.exam-statistic-container.theme-featured {
    background-color: #fcedf1;
}

.exam-statistic-container.theme-popular {
    background-color: #ecfdf5;
}

.exam-statistic-container.theme-collections {
    background-color: #f0f9ff;
}

.exam-statistic-container.theme-all {
    background-color: #f3f4f6;
}

@media (max-width: 992px) {
    .navigation-cards-section {
        padding: 1.75rem 0;
        margin-bottom: 1.75rem;
    }
    
    .navigation-cards-section .section-description {
        margin-bottom: 1.75rem;
    }
    
    .exam-statistic-container {
        min-height: 110px; /* Slightly smaller on tablets */
    }
    
    .exam-statistic-content {
        min-height: 110px;
    }
}

@media (max-width: 768px) {
    .exam-statistic-container {
        min-height: 100px; /* Smaller on mobile */
    }
    
    .exam-statistic-content {
        min-height: 100px;
        padding: 1.25rem;
    }
    
    .exam-statistic-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .navigation-cards-section {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }
    
    .navigation-cards-section .section-description {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .exam-statistic-container {
        min-height: 90px; /* Even smaller on very small screens */
    }
    
    .exam-statistic-content {
        min-height: 90px;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .exam-statistic-icon {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .exam-statistic-title {
        line-height: 1.2; /* Tighter line height */
        margin-bottom: 0.25rem; /* Less margin */
    }
    
    .exam-statistic-subtitle {
        line-height: 1.2; /* Tighter line height */
    }
    
    .navigation-cards-section .row {
        margin-bottom: 0; /* Remove bottom margin from row on mobile */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .exam-statistic-container {
        border: 2px solid;
    }
    
    .exam-statistic-container:hover {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .exam-statistic-container,
    .exam-statistic-overlay,
    .loading-spinner {
        animation: none;
        transition: none;
    }
    
    .exam-stat-featured,
    .exam-stat-popular,
    .exam-stat-collections,
    .exam-stat-all {
        animation: none;
    }
    
    .exam-statistic-container:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .exam-statistic-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .exam-statistic-loading,
    .exam-statistic-overlay {
        display: none;
    }
}

/* Legacy Exam Card Styles */
.exam-card-wrapper {
    background: var(--edtt-color-bg-default, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--edtt-color-border-default, #e5e5e5);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.exam-card-wrapper:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--edtt-color-primary-200, #f5c2d7);
}

.exam-card-img-container {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--edtt-color-bg-secondary, #f8f9fa);
}

.exam-card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.exam-card-wrapper:hover .exam-card-img-container img {
    transform: scale(1.05);
}

.exam-card-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.exam-type-badge {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: var(--edtt-font-size-sm);
    font-weight: 500;
}

.exam-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.exam-card-header-info {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.subject-badge,
.grade-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: var(--edtt-font-size-sm);
    font-weight: 500;
}

.subject-badge {
    background: var(--edtt-color-primary-100, #fcedf1);
    color: var(--edtt-color-primary-600, #be185d);
}

.grade-badge {
    background: var(--edtt-color-secondary-100, #f0f9ff);
    color: var(--edtt-color-secondary-600, #0284c7);
}

.exam-card-title {
    font-size: var(--edtt-font-size-lg);
    font-weight: 500;
    color: var(--edtt-color-text-primary, #1f2937);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: var(--edtt-font-size-sm);
    color: var(--edtt-color-text-secondary, #6b7280);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-item i {
    font-size: var(--edtt-font-size-sm);
}

.progress-section {
    margin-bottom: 1rem;
}

.progress {
    height: 6px;
    background: var(--edtt-color-bg-secondary, #f3f4f6);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: var(--edtt-font-size-sm);
}

.score-info {
    font-size: var(--edtt-font-size-sm);
    color: var(--edtt-color-text-secondary, #6b7280);
}

.score-info i {
    margin-right: 0.25rem;
}

/* Button Styles */
.exam-card-body .btn {
    margin-top: auto;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.exam-card-body .btn-primary {
    background: var(--edtt-color-primary, #ea4c89);
    border-color: var(--edtt-color-primary, #ea4c89);
}

.exam-card-body .btn-primary:hover {
    background: var(--edtt-color-primary-600, #be185d);
    border-color: var(--edtt-color-primary-600, #be185d);
    transform: translateY(-1px);
}

/* Responsive for Legacy Cards */
@media (max-width: 768px) {
    .exam-card-img-container {
        height: 150px;
    }
    
    .exam-card-body {
        padding: 1rem;
    }
    
    .exam-card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}