/* Global Styles */
:root {
    --primary-color: #6200ea;
    --secondary-color: #03dac6;
    --accent-color: #ff6584;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --background-color: #f5f5f5;
    --error-color: #cf6679;
    --text-on-primary: #ffffff;
    --card-background: #ffffff;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    
    /* New vibrant gradient colors */
    --gradient-purple: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --gradient-teal: linear-gradient(135deg, #13547a 0%, #80d0c7 100%);
    --gradient-orange: linear-gradient(135deg, #ff8008 0%, #ffc837 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-pink: linear-gradient(135deg, #f953c6 0%, #b91d73 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for the offline notification */
}

main {
    flex: 1;
}

/* Navigation */
.navbar {
    background-color: var(--card-background);
    box-shadow: var(--box-shadow);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin-right: 10px;
}

.navbar-brand:hover .brand-logo {
    transform: rotate(10deg);
}

.brand-text {
    letter-spacing: 0.5px;
}

/* Custom navbar-toggler styling to match brand color */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(98, 0, 234, 0.25);
}

.navbar-toggler-icon {
    /* background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%236200ea' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;*/
}

.user-info-mobile {
    background-color: var(--primary-color);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 5px 0 10px;
    color: white;
}

.user-info-mobile i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.user-info-mobile .small {
    opacity: 0.85;
}

.navbar-nav .nav-link {
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link:focus {
    color: var(--primary-color);
}

.navbar-nav .active > .nav-link,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Mobile nav adjustments */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--card-background);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 5px;
    }
    
    .navbar-nav .nav-link {
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(98, 0, 234, 0.08);
    }
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header {
    background-color: rgba(98, 0, 234, 0.05);
    border-bottom: 1px solid rgba(98, 0, 234, 0.1);
    color: var(--dark-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Admin specific card header style to ensure text is visible */
.admin-card .card-header h5 {
    color: var(--dark-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #5000d3;
    border-color: #5000d3;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #000;
}

.btn-secondary:hover {
    background-color: #00c4b4;
    border-color: #00c4b4;
    color: #000;
}

/* Forms */
.form-control {
    border-radius: 5px;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* Quiz Cards */
.subject-card {
    margin-bottom: 15px;
    height: auto;
    transition: transform 0.3s ease;
}

.subject-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.subject-item {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    background-color: #fff;
    position: relative;
    padding: 12px;
}

.subject-link:hover .subject-item {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.subject-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    margin-right: 15px;
    margin-left: 8px;
}

.subject-color-0 { background: var(--gradient-purple); }
.subject-color-1 { background: var(--gradient-teal); }
.subject-color-2 { background: var(--gradient-orange); }
.subject-color-3 { background: var(--gradient-green); }
.subject-color-4 { background: var(--gradient-pink); }

.subject-content {
    flex-grow: 1;
    padding: 10px 15px 10px 0;
}

.subject-content h4 {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2rem;
}

.subject-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.stat-item i {
    margin-right: 5px;
}

.explore-btn {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.explore-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.subject-link:hover .explore-btn i {
    transform: translateX(4px);
}

/* Enhanced Topic Cards */
.topic-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.topic-item {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 15px;
    height: 100%;
    display: flex;
    transition: all 0.3s ease;
}

.topic-link:hover .topic-item {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.topic-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
}

.topic-color-0 { background: var(--gradient-purple); }
.topic-color-1 { background: var(--gradient-teal); }
.topic-color-2 { background: var(--gradient-orange); }
.topic-color-3 { background: var(--gradient-green); }
.topic-color-4 { background: var(--gradient-pink); }

.topic-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.topic-content h4 {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.topic-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #666;
}

.topic-stats div {
    display: flex;
    align-items: center;
}

.topic-stats i {
    margin-right: 8px;
    width: 16px;
}

.explore-btn {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.explore-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.topic-link:hover .explore-btn i {
    transform: translateX(4px);
}

/* Enhanced Quiz Cards */
.quiz-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.quiz-item {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(0,0,0,0.125);
}

.quiz-item-attempted {
    border-left: 4px solid var(--secondary-color);
    background-color: rgba(var(--secondary-rgb), 0.05);
}

.quiz-link:hover .quiz-item {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.difficulty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.difficulty-easy {
    background: var(--gradient-green);
}

.difficulty-medium {
    background: var(--gradient-orange);
}

.difficulty-hard {
    background: var(--gradient-pink);
}

.quiz-item h4 {
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    padding-right: 60px;
}

.quiz-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quiz-meta {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.85rem;
}

.quiz-meta i {
    margin-right: 6px;
    color: var(--primary-color);
}

.take-quiz-btn {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    background: var(--gradient-purple);
}

.take-quiz-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.quiz-link:hover .take-quiz-btn i {
    transform: translateX(4px);
}

/* Token Badge */
.badge {
    padding: 0.4rem 0.6rem;
    font-weight: 500;
    border-radius: 4px;
}

.token-cost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.token-cost i {
    color: var(--warning-color);
}

.token-balance {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.token-balance i {
    color: var(--success-color);
}

/* Quiz Questions */
.question-card {
    margin-bottom: 2rem;
}

.question-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number {
    background-color: white;
    color: var(--primary-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.option-label {
    display: block;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    background-color: rgba(108, 99, 255, 0.05);
    border-color: var(--primary-color);
}

.option-input:checked + .option-label {
    background-color: rgba(108, 99, 255, 0.1);
    border-color: var(--primary-color);
}

.option-input {
    display: none;
}

/* Results */
.result-summary {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-percentage {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.result-message {
    font-size: 1.2rem;
    font-weight: 500;
}

.answer-correct {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: var(--success-color);
}

.answer-incorrect {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: var(--danger-color);
}

.explanation {
    padding: 1rem;
    background-color: rgba(23, 162, 184, 0.1);
    border-radius: 5px;
    margin-top: 1rem;
}

/* Token Packages */
.package-card {
    text-align: center;
    padding: 2rem;
}

.package-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.package-tokens {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Subject Cards */
.subject-general_knowledge {
    background-image: url('../images/categories/general_knowledge.png');
}

.subject-science {
    background-image: url('../images/categories/science.png');
}

.subject-history {
    background-image: url('../images/categories/history.png');
}

.subject-geography {
    background-image: url('../images/categories/geography.png');
}

.subject-literature {
    background-image: url('../images/categories/literature.png');
}

.subject-mathematics {
    background-image: url('../images/categories/mathematics.png');
}

.subject-technology {
    background-image: url('../images/categories/technology.png');
}

.subject-sports {
    background-image: url('../images/categories/sports.png');
}

.subject-music {
    background-image: url('../images/categories/music.png');
}

.subject-movies {
    background-image: url('../images/categories/movies.png');
}

.subject-art {
    background-image: url('../images/categories/art.png');
}

.subject-food_drink {
    background-image: url('../images/categories/food_drink.png');
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent-color), #e83e8c);
}

/* Quick Access Grid */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
}

.quick-access-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-access-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.quick-access-item span {
    margin-top: 0.5rem;
    font-weight: 500;
}

.gradient-blue {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
}

.gradient-green {
    background: linear-gradient(135deg, #43a047, #1b5e20);
}

.gradient-purple {
    background: linear-gradient(135deg, #8e24aa, #4a148c);
}

.gradient-orange {
    background: linear-gradient(135deg, #fb8c00, #e65100);
}

/* Enhanced Quiz Cards */
.quiz-card-highlight {
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.quiz-card-highlight:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding: 0.4rem 0.8rem;
    }
    
    .user-info-mobile {
        margin-bottom: 0.5rem !important;
    }
    
    .brand-logo {
        width: 30px;
        height: 30px;
        border-radius: 4px;
        margin-right: 5px;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
    }
    
    .subject-card {
        height: 160px;
    }
    
    .result-score {
        font-size: 2.5rem;
    }
    
    .result-percentage {
        font-size: 1.5rem;
    }
    
    .package-price {
        font-size: 1.8rem;
    }

    .display-5 {
        font-size: 1.8rem;
    }

    .lead {
        font-size: 1rem;
    }

    .quick-access-item {
        padding: 1rem 0.5rem;
    }

    .quick-access-item i {
        font-size: 1.5rem;
    }

    /* Common card adjustments */
    .subject-card, .topic-card, .quiz-card {
        margin-bottom: 12px;
    }
    
    /* Subject card mobile */
    .subject-item {
        padding: 10px;
    }
    
    .subject-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.2rem;
        margin-right: 12px;
        margin-left: 5px;
    }
    
    .subject-content h4 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .subject-stats {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .stat-item {
        font-size: 0.8rem;
    }
    
    /* Topic card mobile */
    .topic-item {
        padding: 12px;
    }
    
    .topic-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-right: 12px;
    }
    
    .topic-icon i {
        font-size: 1rem;
    }
    
    .topic-content h4 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .topic-stats {
        gap: 4px;
        margin-bottom: 8px;
        font-size: 0.8rem;
    }
    
    /* Quiz card mobile */
    .quiz-item {
        padding: 12px;
    }
    
    .difficulty-badge {
        top: 10px;
        right: 10px;
        padding: 2px 8px;
        font-size: 0.65rem;
    }
    
    .quiz-item h4 {
        font-size: 1rem;
        margin-top: 12px;
        margin-bottom: 8px;
    }
    
    .quiz-description {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .take-quiz-btn {
        padding: 6px;
        font-size: 0.85rem;
    }
    
    /* Search and filter area */
    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablet and Desktop Enhancements */
@media (min-width: 769px) {
    .quick-access-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card {
        margin-bottom: 30px;
    }
}

/* Authentication Pages */
.min-vh-70 {
    min-height: 70vh;
}

.welcome-logo {
    display: inline-block;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(108, 99, 255, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
    }
}

.auth-card-container {
    perspective: 1000px;
    margin-bottom: 2rem;
}

.auth-card {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.auth-card:hover {
    transform: translateY(-5px) rotateY(2deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider::before {
    margin-right: 0.5em;
}

.divider::after {
    margin-left: 0.5em;
}

/* PWA Specific Styles */
.add-to-home {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-right: 10px;
    transition: all 0.3s ease;
}

.add-to-home:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* iOS specific styles for PWA */
@supports (-webkit-overflow-scrolling: touch) {
    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
    
    .fixed-bottom {
        padding-bottom: env(safe-area-inset-bottom); /* Handle the iPhone notch */
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }
}

/* Handle PWA status bar */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Show special elements only in PWA mode */
    .pwa-only {
        display: block !important;
    }
    
    /* Hide elements in PWA mode */
    .browser-only {
        display: none !important;
    }
}

/* Hide PWA elements in browser by default */
.pwa-only {
    display: none !important;
}

/* Connection Status Notifications */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

/* Dashboard Icons */
.dashboard-welcome-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background-color: white;
    padding: 2px;
}

.dashboard-welcome-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    background-color: white;
    padding: 1px;
}

/* Admin Dashboard Styles */
.admin-nav {
    background-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

/* Fix for white-on-white tabs in admin panels */
#topicTabs .nav-link, 
#subjectTabs .nav-link,
[id^="topicTabs"] .nav-link {
    color: var(--primary-color);
    background-color: rgba(98, 0, 234, 0.05);
    border: 1px solid rgba(98, 0, 234, 0.1);
    margin-right: 5px;
}

#topicTabs .nav-link.active, 
#subjectTabs .nav-link.active,
[id^="topicTabs"] .nav-link.active {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#topicTabs .nav-link:hover, 
#subjectTabs .nav-link:hover,
[id^="topicTabs"] .nav-link:hover {
    background-color: rgba(98, 0, 234, 0.2);
}

.admin-nav .navbar-brand,
.admin-nav .nav-link {
    color: var(--primary-color);
}

.admin-nav .nav-link:hover, 
.admin-nav .nav-link:focus {
    background-color: rgba(98, 0, 234, 0.08);
}

.admin-nav .active > .nav-link,
.admin-nav .nav-link.active {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Mobile Admin Menu */
@media (max-width: 991.98px) {
    .admin-nav .navbar-nav {
        padding: 0.5rem 0;
    }

    .admin-nav .nav-item {
        padding: 0.25rem 0;
    }

    .admin-nav .nav-link {
        padding: 0.75rem 1.25rem;
    }

    .admin-nav .navbar-collapse.show, 
    .admin-nav .navbar-collapse.collapsing {
        background-color: var(--primary-color);
        border-radius: 0.25rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

/* Responsive table for admin pages */
@media (max-width: 767.98px) {
    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
    }

    .admin-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
    }

    .admin-table tbody td:last-child {
        border-bottom: none;
    }

    .admin-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }
    
    .admin-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

/* Empty State Styling */
.empty-state {
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.empty-state i {
    color: #adb5bd;
    margin-bottom: 15px;
}

.empty-state h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 15px;
}

/* Quiz Bubble Navigation */
.quiz-bubble {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-purple);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    z-index: 1000;
    cursor: grab;
    will-change: transform, width, height;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    touch-action: none; /* Prevents touch scrolling during drag */
    user-select: none; /* Prevents text selection during drag */
}

.quiz-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.quiz-bubble:active {
    cursor: grabbing;
}

.quiz-bubble-expanded {
    width: 300px;
    height: auto;
    max-height: 80vh;
    border-radius: 16px;
    flex-direction: column;
    padding: 15px;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    transform: translateZ(0); /* Force hardware acceleration */
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.quiz-bubble-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.quiz-bubble-expanded .quiz-bubble-content {
    opacity: 1;
    transform: translateY(0);
}

.quiz-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: white;
}

.quiz-bubble-timer {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.quiz-bubble-timer i {
    margin-right: 8px;
}

.quiz-bubble-controls {
    display: flex;
    gap: 10px;
}

.quiz-bubble-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-bubble-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quiz-bubble-questions {
    background: white;
    border-radius: 10px;
    padding: 10px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.quiz-bubble-questions::-webkit-scrollbar {
    width: 6px;
}

.quiz-bubble-questions::-webkit-scrollbar-thumb {
    background-color: rgba(98, 0, 234, 0.5);
    border-radius: 3px;
}

.question-dot-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.question-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-dot:hover {
    transform: scale(1.1);
}

.question-dot.active {
    background-color: var(--primary-color);
    color: white;
}

.question-dot.answered {
    background-color: var(--success-color);
    color: white;
}

.question-dot.current {
    box-shadow: 0 0 0 3px rgba(98, 0, 234, 0.5);
}

/* Quiz Timer Status */
.timer-paused {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Overlay for paused quiz */
.quiz-paused-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

.quiz-paused-message {
    background-color: var(--primary-color);
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.quiz-paused-message h2 {
    margin-bottom: 20px;
}

.resume-quiz-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resume-quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .quiz-bubble-expanded {
        width: 280px;
        right: 10px;
        bottom: 10px;
    }
    
    .quiz-bubble-timer {
        font-size: 1.2rem;
    }
    
    .quiz-bubble-btn {
        width: 36px;
        height: 36px;
    }
    
    .question-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Paused Quiz Item Styles in Dashboard */
.paused-quiz-card {
    border-left: 4px solid var(--warning-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.paused-quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Quiz Resume Button */
.resume-quiz-card-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.resume-quiz-card-btn:hover {
    background: var(--primary-dark-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
} 