/* 
 * English Learning Pro - Complete CSS Styles
 * CELPIP, IELTS, PTE Training Platform
 * CV Raman Nagar, Bangalore, Karnataka 560073
 */

/* ===============================
   GLOBAL STYLES
   =============================== */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --transition: all 0.3s ease;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
}

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

/* ===============================
   NAVIGATION STYLES
   =============================== */

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.85);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

/* ===============================
   HERO SECTION
   =============================== */

.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    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" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-image {
    position: relative;
    z-index: 1;
}

.floating-card {
    animation: float 3s ease-in-out infinite;
    max-width: 200px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.main-icon {
    font-size: 8rem;
    opacity: 0.1;
}

.counter {
    font-weight: 700;
    color: inherit;
}

/* ===============================
   CARD STYLES
   =============================== */

.card {
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.test-card {
    height: 100%;
}

.test-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-box {
    transition: var(--transition);
}

.metric-box:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.mock-test-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===============================
   FEATURE STYLES
   =============================== */

.feature-card {
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===============================
   PRICING STYLES
   =============================== */

.pricing-plan {
    padding: 2rem;
    text-align: center;
}

.plan-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
}

/* ===============================
   CONTACT STYLES
   =============================== */

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* ===============================
   CHAT WIDGET STYLES
   =============================== */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1050;
    font-size: 0.9rem;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    display: flex;
    flex-direction: column;
    height: 400px;
    max-height: 60vh;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 300px;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

.message-content {
    max-width: 80%;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    background: var(--light-color);
    margin: 0 0.5rem;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.message-avatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

.chat-suggestions {
    margin-top: 0.5rem;
}

/* ===============================
   TEST INTERFACE STYLES
   =============================== */

.test-timer {
    position: fixed;
    top: 70px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1040;
    min-width: 200px;
    text-align: center;
}

.timer-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

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

.timer-warning {
    color: var(--warning-color) !important;
}

.timer-danger {
    color: var(--danger-color) !important;
    animation: pulse 1s infinite;
}

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

.timer-progress {
    margin-top: 0.5rem;
}

.audio-player {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.audio-progress {
    margin: 1rem 0;
}

.volume-control {
    display: flex;
    align-items: center;
}

.question-navigator {
    margin-bottom: 1rem;
}

.question-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    font-size: 0.8rem;
    padding: 0;
}

.part-item {
    transition: var(--transition);
}

.part-item:hover {
    background-color: var(--light-color);
}

.stats-card {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

/* ===============================
   ADMIN PANEL STYLES
   =============================== */

.admin-sidebar {
    background: var(--dark-color);
    color: white;
    min-height: calc(100vh - 56px);
    padding: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: var(--transition);
}

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

.admin-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

/* ===============================
   DASHBOARD STYLES
   =============================== */

.achievement-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.achievement-item:hover {
    background-color: var(--light-color);
}

.achievement-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-item {
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* ===============================
   RESULTS & REVIEW STYLES
   =============================== */

.score-circle {
    font-size: 1.2rem;
}

.question-review {
    transition: var(--transition);
}

.question-review:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.option-item {
    transition: var(--transition);
}

.option-item:hover {
    background-color: var(--light-color) !important;
}

.explanation {
    border-left: 4px solid var(--info-color);
}

/* ===============================
   FORM STYLES
   =============================== */

.form-control {
    border-radius: var(--border-radius);
    transition: var(--transition);
}

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

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.password-requirements {
    margin-top: 0.5rem;
}

.req-item {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.divider {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.divider-text {
    background: white;
    padding: 0 1rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ===============================
   MODAL STYLES
   =============================== */

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background: var(--light-color);
}

.modal-title {
    font-weight: 600;
}

/* ===============================
   UTILITY CLASSES
   =============================== */

.text-decoration-none {
    text-decoration: none !important;
}

.border-0 {
    border: 0 !important;
}

.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
    box-shadow: var(--box-shadow-lg) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

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

.min-vh-100 {
    min-height: 100vh !important;
}

/* ===============================
   RESPONSIVE STYLES
   =============================== */

@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }

    .floating-card {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        margin: 1rem auto;
        display: inline-block;
    }

    .main-icon {
        font-size: 4rem;
    }

    .test-timer {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        width: 100%;
    }

    .chat-widget {
        width: 300px;
        bottom: 10px;
        right: 10px;
    }

    .chat-body {
        height: 300px;
    }

    .price {
        font-size: 2rem;
    }

    .feature-card,
    .pricing-plan {
        padding: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }

    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1rem;
    }

    .chat-widget {
        width: calc(100vw - 20px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .stats-number {
        font-size: 1.5rem;
    }

    .feature-card,
    .pricing-plan {
        padding: 1rem;
    }

    .test-card .card-body {
        padding: 1rem;
    }

    .metric-box {
        padding: 0.5rem !important;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ===============================
   PRINT STYLES
   =============================== */

@media print {
    .navbar,
    .chat-widget,
    .test-timer,
    .btn,
    .footer {
        display: none !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }

    .bg-primary,
    .bg-success,
    .bg-danger,
    .bg-warning,
    .bg-info {
        background: white !important;
        color: black !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* ===============================
   ACCESSIBILITY STYLES
   =============================== */

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.focus-visible:focus {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* Ensure sufficient color contrast */
.text-muted {
    color: #6c757d !important;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

    .btn {
        border-width: 2px;
    }

    .form-control {
        border-width: 2px;
    }
}

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

    .floating-card {
        animation: none;
    }
}

/* ===============================
   DARK MODE SUPPORT
   =============================== */

@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #ffffff;
        --light-color: #2d3748;
    }

    body {
        background-color: #1a202c;
        color: #ffffff;
    }

    .card {
        background-color: #2d3748;
        color: #ffffff;
    }

    .modal-content {
        background-color: #2d3748;
        color: #ffffff;
    }

    .form-control {
        background-color: #4a5568;
        border-color: #718096;
        color: #ffffff;
    }

    .chat-widget {
        background-color: #2d3748;
        color: #ffffff;
    }

    .message-content {
        background-color: #4a5568;
        color: #ffffff;
    }
}