/* EduSpot Custom Styles */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --success-color: #059669;
    --info-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #dc2626;
    --purple-color: #8b5cf6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --font-family: 'Nunito', sans-serif;
}

/* Global Styles */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 700;
}

.display-4, .display-5, .display-6 {
    font-weight: 800;
}

/* Custom Colors */
.text-purple { color: var(--purple-color) !important; }
.bg-purple { background-color: var(--purple-color) !important; }
.btn-purple {
    background-color: var(--purple-color);
    border-color: var(--purple-color);
    color: white;
}
.btn-purple:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: white;
}
.btn-outline-purple {
    color: var(--purple-color);
    border-color: var(--purple-color);
}
.btn-outline-purple:hover {
    background-color: var(--purple-color);
    border-color: var(--purple-color);
    color: white;
}

/* Navigation */
.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
}

.brand-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.navbar-nav .nav-link {
    font-weight: 600;
    transition: color 0.3s ease;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.min-vh-50 {
    min-height: 50vh;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.feature-card {
    border-top: 4px solid var(--primary-color);
}

.feature-card:nth-child(2) { border-top-color: var(--secondary-color); }
.feature-card:nth-child(3) { border-top-color: var(--info-color); }
.feature-card:nth-child(4) { border-top-color: var(--warning-color); }
.feature-card:nth-child(5) { border-top-color: var(--danger-color); }
.feature-card:nth-child(6) { border-top-color: var(--purple-color); }

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

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

/* Icons */
.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: 50%;
    margin: 0 auto;
}

/* Educational Tool Specific Styles */

/* Flashcard Styles */
.flashcard-container {
    perspective: 1000px;
}

.flashcard {
    width: 100%;
    height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    color: white;
}

.card-back {
    background: linear-gradient(45deg, var(--secondary-color), var(--warning-color));
    color: white;
    transform: rotateY(180deg);
}

.card-content {
    padding: 2rem;
    text-align: center;
}

/* Vocabulary Styles */
.vocabulary-item {
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.vocabulary-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

/* Quiz Styles */
.quiz-question {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(16, 185, 129, 0.05));
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1rem;
}

.quiz-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
}

.quiz-option.correct {
    border-color: var(--secondary-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--danger-color);
    background-color: rgba(220, 38, 38, 0.1);
}

/* Coloring Styles */
.color-picker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-picker:hover, .color-picker.active {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.tool-btn.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Word Scrambler Styles */
.scrambled-word-display {
    background: linear-gradient(45deg, rgba(220, 38, 38, 0.1), rgba(245, 158, 11, 0.1));
    border-radius: 1rem;
    padding: 2rem;
    margin: 1rem 0;
}

.letter-spacing-wide {
    letter-spacing: 0.5rem;
}

.word-history-item {
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem;
    font-weight: 600;
}

.word-correct {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.word-skipped {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Word Search Styles */
.word-search-grid {
    display: grid;
    gap: 2px;
    justify-content: center;
    background-color: #f1f5f9;
    padding: 1rem;
    border-radius: 0.75rem;
    max-width: 100%;
    overflow: auto;
}

.word-search-cell {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.word-search-cell:hover {
    background-color: rgba(79, 70, 229, 0.1);
}

.word-search-cell.selected {
    background-color: var(--primary-color);
    color: white;
}

.word-search-cell.found {
    background-color: var(--secondary-color);
    color: white;
}

.word-list-item {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.word-list-item.found {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary-color);
    text-decoration: line-through;
}

/* Category Buttons */
.category-btn {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

/* Statistics */
.stat-item h4 {
    font-size: 2.5rem;
    font-weight: 800;
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

/* Alerts */
.alert {
    border-radius: 0.75rem;
    border: none;
    font-weight: 500;
}

/* Footer */
footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white !important;
}

/* Loading Animations */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Feedback */
.feedback-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
}

.feedback-error {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .card-front, .card-back {
        height: 250px;
    }
    
    .word-search-cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .scrambled-word-display .display-4 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .category-btn {
        min-height: 80px;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, footer, .card-header {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .word-search-grid {
        background: white !important;
    }
    
    .word-search-cell {
        border: 1px solid #000 !important;
        background: white !important;
        color: black !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border-width: 3px;
    }
}

/* Custom Utilities */
.shadow-soft {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.border-radius-lg {
    border-radius: 1rem !important;
}

.bg-gradient-light {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Fix for hero section image overlapping buttons */
.hero-section img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.hero-section .btn {
    position: relative;
    z-index: 2;
}

