/* Front Subjects Page Styles */

.subjects-hero {
    background: linear-gradient(
            135deg,
            rgba(188, 95, 66, 0.9),
            rgba(0, 70, 80, 0.9)
        ),
        url("/assets/img/subjects-bg.jpg");
    background-size: cover;
    background-position: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    color: #fff;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.subjects-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.subjects-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.subjects-header h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subjects-header p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

.subjects-container {
    padding: 80px 0;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
}

.subjects-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--primary-color);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.subject-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    perspective: 1000px;
    transform-style: preserve-3d;
    height: auto;
    cursor: pointer;
}

.subject-card:hover {
    transform: rotateY(10deg) translateZ(20px);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.2);
}

.subject-front,
.subject-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: all 0.6s ease;
}

.subject-front {
    background-color: #fff;
    z-index: 2;
}

.subject-back {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    transform: rotateY(180deg);
    color: #fff;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.subject-card.flipped .subject-front {
    transform: rotateY(-180deg);
}

.subject-card.flipped .subject-back {
    transform: rotateY(0);
    z-index: 3;
}

.subject-card:hover .subject-image img {
    transform: scale(1.1);
}

.subject-content {
    padding: 20px;
    text-align: center;
}

.subject-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subject-content p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.subject-back h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.subject-back p {
    margin-bottom: 20px;
    font-size: 14px;
}

.subject-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.subject-card:hover .subject-icon {
    transform: rotateY(360deg);
    border-color: rgba(255, 255, 255, 0.6);
}

.subject-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.subject-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subject-stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
}

.subject-stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.subject-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: #fff;
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.subject-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
}

.flip-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
}

.flip-btn:hover {
    transform: scale(1.1);
}

.subject-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 15px;
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}

/* Animation classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}
.delay-2 {
    transition-delay: 0.2s;
}
.delay-3 {
    transition-delay: 0.3s;
}
.delay-4 {
    transition-delay: 0.4s;
}
.delay-5 {
    transition-delay: 0.5s;
}

/* Dark mode styles */
:root.dark-theme .subjects-container {
    background-color: var(--background);
}

:root.dark-theme .subject-front {
    background-color: var(--card-bg);
}

:root.dark-theme .subject-content h3 {
    color: #ffffff;
}

:root.dark-theme .subject-content p {
    color: var(--text-color);
}

:root.dark-theme .subject-stats {
    border-top-color: var(--border-color);
}

:root.dark-theme .subject-stat-value {
    color: var(--primary-color);
}

:root.dark-theme .subject-stat-label {
    color: var(--text-light);
}

:root.dark-theme .filter-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--primary-color);
}

:root.dark-theme .filter-btn:hover,
:root.dark-theme .filter-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

:root.dark-theme .subjects-hero {
    background: linear-gradient(
            135deg,
            rgba(188, 95, 66, 0.9),
            rgba(0, 70, 80, 0.9)
        ),
        url("/assets/img/dark-subjects-bg.jpg");
}

/* New styles for redesigned subject show page */
/* Subject Hero */
.subject-hero {
    min-height: 300px;
    background-size: cover !important;
    background-position: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
}

.subject-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.subject-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Subject Content */
.subject-content {
    padding: 40px 0;
    background-color: #f9f9f9;
    position: relative;
}

.subject-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

/* Fix for the subject image to display properly as a rounded image */
.subject-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--primary-color);
    margin: 0 auto 25px; /* Adjusted margin to fix positioning */
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex; /* Added to ensure proper image centering */
    align-items: center;
    justify-content: center;
}

.subject-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Ensures proper rendering */
}

/* If the image is inside a card with negative margin positioning */
.subject-card .subject-image {
    margin-top: -20px; /* Move this property here to properly position the image */
}

/* Department badges styling */
.subject-department {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.subject-department-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 10px auto;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.subject-department-badge:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Add a slight staggered animation for multiple badges */
@keyframes fadeInBadge {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subject-department-badge {
    animation: fadeInBadge 0.4s ease forwards;
}

.subject-department-badge:nth-child(2) {
    animation-delay: 0.1s;
}

.subject-department-badge:nth-child(3) {
    animation-delay: 0.2s;
}

/* Status Badge */
.status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 15px;
    background-color: #ef4444;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
}

/* Stats Section */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.stat-box {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    text-align: center;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: rgba(var(--primary-rgb), 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
    font-size: 24px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* About Section */
.subject-about {
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(var(--primary-rgb), 0.02);
    border-right: 4px solid var(--primary-color);
}

.subject-about h2,
.subject-chapters h2,
.subject-tests h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
}

.subject-about h2:after,
.subject-chapters h2:after,
.subject-tests h2:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.subject-about p {
    line-height: 1.6;
}

/* Chapters Section */
.subject-chapters {
    margin-bottom: 40px;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.chapter-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    background: white;
}

:root.dark-theme .chapter-card {
    box-shadow: 0 5px 15px var(--dark-color);
}

.chapter-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.chapter-header {
    padding: 15px;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
}

.chapter-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.chapter-body {
    padding: 15px;
}

.chapter-body p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.chapter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 15px;
}

.chapter-btn {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.chapter-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    color: white;
    text-decoration: none;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Tests Section */
.subject-tests {
    margin-bottom: 20px;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.test-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.test-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.test-content {
    padding: 20px;
}

.test-content h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-badges {
    display: flex;
    gap: 10px;
}

.test-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.test-badge.primary {
    background-color: var(--primary-color);
}

.test-badge.secondary {
    background-color: var(--secondary-color);
}

.test-btn {
    padding: 6px 15px;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.test-btn:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.view-all-tests {
    text-align: center;
    margin-top: 30px;
}

.all-tests-btn {
    padding: 10px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.all-tests-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    color: white;
    text-decoration: none;
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-hero-text h1 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

.animate-hero-text p {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.animate-image {
    opacity: 0;
    transform: scale(0.8);
    animation: zoomIn 1s ease forwards;
}

.animate-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.animate-stat {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.animate-chapter {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.animate-test {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

/* Define animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Add CSS variable for primary color RGB */
:root {
    --primary-rgb: 0, 70, 80;
}

:root.dark-theme {
    --primary-rgb: 0, 70, 80;
}

/* Dark mode adjustments */
:root.dark-theme .subject-card,
:root.dark-theme .chapter-card,
:root.dark-theme .test-card,
:root.dark-theme .subject-image {
    background: var(--card-bg);
    box-shadow: 0 5px 15px var(--dark-color);
}

:root.dark-theme .subject-about {
    background: rgba(var(--primary-rgb), 0.1);
}

:root.dark-theme .stat-box {
    background: rgba(var(--primary-rgb), 0.15);
}

:root.dark-theme a {
    color: var(--primary-rgb);
}

/* Responsive styles */
@media (max-width: 768px) {
    .subject-hero h1 {
        font-size: 2rem;
    }

    .subject-hero p {
        font-size: 1rem;
    }

    .stats-row {
        flex-direction: column;
        gap: 15px;
    }

    .stat-box {
        min-width: 100%;
    }

    .chapters-grid,
    .tests-grid {
        grid-template-columns: 1fr;
    }

    .subject-card {
        padding: 20px;
        margin-top: -40px;
    }

    .subject-image {
        width: 100px;
        height: 100px;
        margin: -70px auto 20px;
    }
}

@media (max-width: 576px) {
    .chapter-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .chapter-btn {
        width: 100%;
        text-align: center;
    }

    .test-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .test-btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}
