/* InterGlobal Educa - Custom Styles */

/* CSS Variables */
:root {
    --brand-red: #DC2626;
    --brand-black: #000000;
    --brand-white: #FFFFFF;
    --brand-gray: #F3F4F6;
    --brand-gray-dark: #6B7280;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Button Styles */
.btn-primary {
    background-color: var(--brand-red);
    color: white;
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #B91C1C;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--brand-black);
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: 600;
    border: 2px solid var(--brand-black);
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--brand-gray);
}

/* Hero Pattern Background */
.hero-pattern {
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brand-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat Interface Styles */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.ai {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message-bubble.user {
    background-color: var(--brand-red);
    color: white;
}

.message-bubble.ai {
    background-color: #e5e5e5;
    color: var(--brand-black);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--brand-red);
    transition: width 0.3s ease;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--brand-black);
}

/* Dashboard Stats */
.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Lesson Cards */
.lesson-card {
    @apply bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow;
}

.lesson-card.completed {
    @apply border-2 border-green-500;
}

/* Lesson Modal Styles */
.lesson-header {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.lesson-tab {
    @apply text-gray-600 hover:text-brand-red transition-colors;
}

.lesson-tab.active {
    @apply text-brand-red border-b-2 border-brand-red;
}

.lesson-tab-content {
    min-height: 400px;
}

/* Theory Content Styles */
.rule-box {
    @apply bg-blue-50 border-l-4 border-blue-500 p-4 my-4;
}

.tip-box {
    @apply bg-yellow-50 border-l-4 border-yellow-500 p-4 my-4;
}

.example-grid {
    @apply grid grid-cols-2 md:grid-cols-4 gap-4 my-4;
}

.example-grid > div {
    @apply bg-gray-100 p-3 rounded text-center font-mono;
}

.pattern-box {
    @apply bg-green-50 border border-green-300 rounded-lg p-4 my-4;
}

.comparison-box {
    @apply bg-gray-50 rounded-lg p-4 my-4;
}

.comparison-grid {
    @apply grid md:grid-cols-2 gap-4 mt-4;
}

.transformation-box table {
    @apply w-full border-collapse my-4;
}

.transformation-box th,
.transformation-box td {
    @apply border border-gray-300 p-3 text-left;
}

.transformation-box th {
    @apply bg-gray-100 font-bold;
}

/* Vocabulary Cards */
.vocabulary-card {
    @apply hover:shadow-md transition-shadow cursor-pointer;
}

.vocabulary-card:hover {
    @apply bg-gray-100;
}

/* Exercise Styles */
.exercise-block {
    @apply bg-gray-50 hover:bg-gray-100 transition-colors;
}

.exercise-answer {
    @apply focus:ring-2 focus:ring-brand-red focus:border-transparent;
}

.exercise-answer.border-green-500 {
    @apply bg-green-50;
}

.exercise-answer.border-red-500 {
    @apply bg-red-50;
}

/* Quiz Styles */
.quiz-question {
    @apply bg-white;
}

.quiz-question.border-green-500 {
    @apply bg-green-50 border-green-500;
}

.quiz-question.border-red-500 {
    @apply bg-red-50 border-red-500;
}

.quiz-answer {
    @apply w-4 h-4 text-brand-red focus:ring-brand-red;
}

/* Special Content Boxes */
.alphabet-table {
    @apply w-full my-4;
}

.alphabet-table td {
    @apply p-3 text-center bg-gray-50 border border-gray-200;
}

.alphabet-table td:hover {
    @apply bg-yellow-100 cursor-pointer;
}

.number-grid {
    @apply grid grid-cols-2 md:grid-cols-4 gap-2 my-4;
}

.number-grid > div {
    @apply bg-gray-100 p-2 rounded text-center text-sm;
}

.months-grid {
    @apply grid grid-cols-2 md:grid-cols-3 gap-3 my-4;
}

.months-grid > div {
    @apply bg-blue-50 p-3 rounded;
}

.days-week ul,
.months-year ul {
    @apply space-y-2;
}

.family-grid {
    @apply grid grid-cols-2 gap-3 my-4;
}

.family-grid > div {
    @apply bg-pink-50 p-3 rounded;
}

.dialogue-box {
    @apply bg-gray-100 p-4 rounded-lg my-4 font-mono text-sm;
}

.qa-pairs {
    @apply space-y-4;
}

.qa-pair {
    @apply bg-white p-4 rounded-lg shadow;
}

/* Animations */
@keyframes bounce-in {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-bounce-in {
    animation: bounce-in 0.5s ease-out;
}

/* Achievement Modal */
.achievement-modal {
    backdrop-filter: blur(5px);
}

/* Audio Button Animation */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Progress Bar */
.progress-fill {
    @apply transition-all duration-500 ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lesson-modal > div {
        @apply max-w-full m-4;
    }
    
    .lesson-content {
        @apply p-4;
    }
    
    .lesson-tabs {
        @apply overflow-x-auto;
    }
    
    .lesson-tab {
        @apply whitespace-nowrap;
    }
}

/* Print styles for certificates */
@media print {
    .no-print {
        display: none !important;
    }
    
    .certificate {
        @apply border-4 border-gray-800 p-12;
        page-break-inside: avoid;
    }
}

/* Custom scrollbar for lesson content */
.lesson-content::-webkit-scrollbar {
    width: 8px;
}

.lesson-content::-webkit-scrollbar-track {
    @apply bg-gray-100;
}

.lesson-content::-webkit-scrollbar-thumb {
    @apply bg-gray-400 rounded;
}

.lesson-content::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-500;
}

/* Responsive Tables */
.responsive-table {
    overflow-x: auto;
}

.responsive-table table {
    min-width: 600px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--brand-black);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-pattern {
        background-size: 15px 15px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .stat-card {
        padding: 16px;
    }
}

/* Print Styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    p { font-size: 0.875rem; }
}

/* Mobile First Responsive */
@media (max-width: 768px) {
    .hero-pattern {
        background-size: 15px 15px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .stat-card {
        padding: 16px;
    }
    
    /* Dashboard specific */
    .lesson-modal > div {
        max-w-full;
        margin: 1rem;
        height: calc(100vh - 2rem);
    }
    
    .lesson-content {
        padding: 1rem;
    }
    
    .lesson-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .lesson-tab {
        white-space: nowrap;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Navigation adjustments */
    nav a {
        font-size: 0.875rem;
    }
    
    /* AI Tutor adjustments */
    .ai-tutor-chat {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    .ai-tutor-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    /* Form inputs */
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Cards and containers */
    .card-hover:hover {
        transform: none; /* Disable hover effects on mobile */
    }
    
    /* Tables */
    table {
        font-size: 0.875rem;
    }
    
    /* Grid adjustments */
    .example-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Responsive */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    /* Dashboard sidebar */
    aside {
        width: 220px;
    }
    
    main {
        margin-left: 220px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    /* Enhanced hover effects for desktop */
    .card-hover:hover {
        transform: translateY(-8px);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1536px;
    }
    
    body {
        font-size: 18px;
    }
}

/* Print styles for certificates and PDFs */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        color: black;
        text-decoration: none;
    }
    
    .certificate {
        border: 4px solid #000;
        padding: 48px;
        page-break-inside: avoid;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    .ai-tutor-send-btn {
        width: 50px;
        height: 50px;
    }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .ai-tutor-chat {
        height: 100vh;
        max-height: 100vh;
    }
    
    header {
        position: sticky;
        top: 0;
        z-index: 100;
    }
}

/* Responsive utilities */
.hide-mobile {
    display: block !important;
}

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

.hide-tablet {
    display: block !important;
}

@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

.show-mobile {
    display: none !important;
}

@media (max-width: 640px) {
    .show-mobile {
        display: block !important;
    }
}

/* Smooth transitions for responsive changes */
* {
    transition: padding 0.3s ease, margin 0.3s ease, font-size 0.3s ease;
} 