body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f8;
    overflow-y: scroll;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 25px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}
/* Left Section (Logo) */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 40px;
}

.brand-name {
    font-size: 20px;
    font-weight: bold;
    color: #f4a31e;
}

/* Center Section (Nav Links) */
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    padding: 10px 15px;
    transition: color 0.3s ease-in-out;
}

.nav-links a.active {
    color: #f4a31e;
    border-bottom: 3px solid #f4a31e;
}

.nav-links a:hover {
    color: #f4a31e;
}

/* Right Section ( Profile + Logout) */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.profile img {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.profile span {
    font-size: 14px;
    color: #333;
}

#user-profile-link{
    text-decoration: none;
    color: #333;
}
#user-profile-link:hover{
    color: #f4a31e;
    text-shadow: #1f2937;
    text-decoration: underline;
    
}
/* Logout Button */
.logout-btn {
    background-color: #8835e6;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0px 3px 10px rgba(162, 0, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin-right: 35px;
}

.logout-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover {
    transform: scale(1.05);
    box-shadow: 0px 5px 15px rgba(204, 0, 255, 0.4);
}

/* Card Grid */
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 40px;
    padding-top: 25px;
}

/* Responsive Navbar */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        background: white;
        width: 200px;
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        border-radius: 8px;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        text-align: center;
        padding: 10px 0;
    }

    .menu-toggle {
        display: block;
        font-size: 24px;
        background: none;
        border: none;
        cursor: pointer;
    }
}

/* Hide the menu toggle button on larger screens */
@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}

/* Card Styles */
.card {
    width: 300px;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-image {
    height: 150px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
}

.card-content {
    padding: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px;
}

.card-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 20px;
}

.card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.card-tag {
    font-size: 12px;
    color: #4f46e5;
    background-color: #eef2ff;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.card-tag:hover {
    background-color: #4f46e5;
    color: white;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Star Rating */
.card-rating {
    display: flex;
    gap: 4px;
}

.star {
    width: 20px;
    height: 20px;
    fill: #FFD700; /* Gold color */
    transition: transform 0.3s ease;
}

.star:hover {
    transform: scale(1.2);
}

.card-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.card-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}


.dashboard-title {
    padding-top: 65px;
    text-align: left;
    background-color: #f4f4f4;
    border-radius: 8px;
    margin: 20px auto;
    width: 90%;
    margin-left: 30px;
}

.dashboard-title {
    font-size: 2rem;
    color: #5a2d82; 

}
@media (max-width: 768px) {

    .dashboard-title {
        padding-top: 12%;
    }
}


.quiz-details-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001; /* Higher than overlay */
    transform: translateY(100%); /* Start off-screen */
    transition: transform 0.3s ease;
}
.quiz-title{
    color: #5a2d82; 
    margin-bottom: -5px;
}

.quiz-details-modal.show {
    transform: translateY(0); /* Slide up to visible */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
}

.quiz-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 24px;
}

.difficulty-section h3 {
    color: #1f2937;
    margin-bottom: 16px;
}

.difficulty-options {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.difficulty-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #4b5563;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-btn:hover {
    border-color: #8835e6;
    color: #8835e6;
}

.difficulty-btn.selected {
    background: #8835e6;
    border-color: #8835e6;
    color: white;
}

.start-quiz-btn {
    width: 100%;
    padding: 16px;
    background: #8835e6;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.start-quiz-btn:hover {
    background: #7029cc;
    transform: translateY(-2px);
}

.start-quiz-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .quiz-details-modal {
        width: 500px;
        left: 50%;
        margin-left: -250px; /* Half of width */
    }
}

/* Mobile styles */
@media (max-width: 768px) {

    .logo {
        height: 25px;
    }
    
    .brand-name {
        font-size: 14px;
    }
    
    .nav-links {
        top: 50px; /* Adjusted position */
    }
    
    .nav-links a {
        font-size: 13px;
        padding: 6px 8px;
    }
    
    .profile img {
        height: 24px;
        width: 24px;
    }
    
    .logout-btn {
        font-size: 11px;
    }       
    
    .dashboard-title {
        padding-top: 16%; 
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .navbar {
        flex-wrap: wrap;
        padding: 12px 22px;
    }
    
    .navbar-left, .navbar-right {
        gap: 12px;
    }
    
    .logout-btn {
        padding: 5px 9px;
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .quiz-details-modal {
        width: 93%;
        max-height: 70vh;
        padding: 15px;
    }
    
    .difficulty-options {
        flex-direction: column; 
    }
    
    .difficulty-btn {
        width: 100%;
        margin: 5px 0; 
        padding: 12px; 
    
    .modal-header {
        padding: 10px 0;
    }
    
    .quiz-title {
        font-size: 1.3rem; 
    }
    
    .quiz-description {
        font-size: 0.9rem; 
        margin-bottom: 15px;
    }
    
    .start-quiz-btn {
        width: 100%;
        padding: 12px;
        margin-top: 10px;
    }
} 
}

/* Search bar styles */
.title-search-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    margin-top: 70px;
    margin-right: 20px;
}

#quiz-search {
    padding: 10px 15px;
    padding-right: 40px; /* More space for icon */
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px; 
    font-size: 16px;
    width: 200px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333;
}

#quiz-search:focus {
    outline: none;
    border-color: rgba(175, 76, 167, 0.3); /* Subtle green border */
    background-color: rgba(255, 255, 255, 0.767);
    box-shadow: 0 2px 8px rgba(155, 76, 175, 0.1);
    width: 300px;
}

.search-icon {
    position: absolute;
    right: 15px;
    pointer-events: none;
    color: #777;
    font-size: 18px;
    margin-right: 20px;
}

/* Placeholder styling */
#quiz-search::placeholder {
    color: #999;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .title-search-container {
        gap: 12px;
    }
    
    .search-container {
        width: 100%;
    }
    
    #quiz-search {
        width: 100%;
        padding: 11px 16px;
        padding-right: 45px;
        font-size: 12px;
    }
    
    #quiz-search:focus {
        width: 100%;
    }
}

.card {
    opacity: 0; 
    transform: translateY(20px); 
    transition: 
        opacity 0.5s ease-out,
        transform 0.8s ease-out,
        box-shadow 0.8s ease; 
}

/* Animation Trigger Class */
.card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
