/* Simple LMS Styles - Clean and functional - Mobile First */

/* Import Bootstrap for basic functionality */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css');

/* Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Modern Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css');

/* ====================
   BASE STYLES - MOBILE FIRST
   ==================== */

/* Basic font styling - Mobile optimized */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    background-color: #f8f9fa;
}

/* Typography scale for mobile */
h1, .display-4, .hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2, .display-5, .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h3, .display-6 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

p, .lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Better link styling for mobile */
a {
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover, a:focus {
    color: #0056b3;
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background-color: #fff !important;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand h2 {
    color: #007bff !important;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 100px 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.feature-card {
    text-align: center;
    padding: 2rem;
    margin-bottom: 1rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

/* Course cards */
.course-card {
    border: none;
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-image {
    height: 200px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-price {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Stats */
.stats-section {
    background-color: #f8f9fa;
    padding: 60px 0;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 40px 0;
    margin-top: auto;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-section {
        padding: 40px 0;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Basic animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form styling */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alerts */
.alert {
    border-radius: 6px;
    border: none;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ====================
   MOBILE RESPONSIVE DESIGN - COMPREHENSIVE
   ==================== */

/* Small phones (576px and down) */
@media (max-width: 575.98px) {
    /* Container & Layout */
    .container {
        padding-left: 10px;
        padding-right: 10px;
        max-width: 100%;
    }

    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .col, [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Typography - Mobile optimized */
    .hero-title, .display-4 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .hero-subtitle, .display-6 {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .display-5, .section-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .display-6 {
        font-size: 1.125rem;
    }

    .lead {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Navigation - Mobile optimizations */
    .navbar-brand h2 {
        font-size: 1.25rem;
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem;
        border-radius: 0.375rem;
        background-color: #f8f9fa;
    }

    .navbar-nav {
        margin-top: 1rem;
        padding: 1rem 0;
    }

    .nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
        margin: 0.25rem 0;
        display: flex;
        align-items: center;
    }

    .nav-link i {
        margin-right: 0.5rem;
    }

    .nav-auth-buttons {
        flex-direction: column;
        margin-top: 1rem;
    }

    .nav-auth-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    /* Forms - Touch friendly */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #ddd;
        height: auto;
    }

    .form-control:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        outline: none;
    }

    .btn {
        font-size: 0.95rem;
        padding: 0.625rem 1.25rem;
        min-height: 44px; /* Touch target size */
        border-radius: 0.5rem;
        font-weight: 600;
    }

    .btn-sm {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        min-height: 40px;
    }

    /* Hero Section - Mobile optimized */
    .hero-section {
        padding: 3rem 0 2rem;
        text-align: center;
        min-height: auto;
    }

    .hero-content h1,
    .hero-content .hero-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-content h1 + p,
    .hero-content .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }

    /* Cards - Touch optimized */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .card-body {
        padding: 1.25rem;
    }

    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .feature-icon {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
        margin: 0 auto 1rem;
    }

    .card-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    /* Course Cards - Mobile optimized */
    .course-card {
        margin-bottom: 1.25rem;
    }

    .course-image {
        height: 150px;
        border-radius: 0.75rem 0.75rem 0 0;
    }

    .course-price {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    /* Stats - Mobile friendly */
    .stats-section {
        padding: 2rem 0;
    }

    .stat-item {
        margin-bottom: 1.25rem;
        text-align: center;
    }

    .stat-number {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .stat-label {
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .testimonial-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 0.75rem;
    }

    /* Dropdowns - Touch friendly */
    .dropdown-menu {
        width: 100%;
        border-radius: 0.75rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        border: none;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
        margin: 0.25rem;
    }

    .dropdown-item i {
        margin-right: 0.5rem;
    }

    /* Carousel - Touch optimized */
    .carousel {
        touch-action: pan-y;
    }

    .carousel-indicators {
        bottom: -40px;
    }

    .carousel-indicators button {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin: 0 4px;
    }

    /* Alerts - Mobile optimized */
    .alert {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        font-size: 0.95rem;
    }

    /* Modals - Full screen on very small devices */
    @media (max-width: 480px) {
        .modal-dialog {
            margin: 0.5rem;
            max-width: none;
            width: auto;
        }

        .modal-content {
            border-radius: 0.75rem;
        }
    }

    /* Tables - Horizontal scroll on small screens */
    .table-responsive {
        font-size: 0.875rem;
    }

    /* Badges - Better visibility */
    .badge {
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.375rem 0.625rem;
    }
}

/* Medium devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .feature-card {
        padding: 1.75rem;
    }

    .course-image {
        height: 180px;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .feature-card {
        padding: 2.5rem;
    }

    .course-image {
        height: 220px;
    }

    .stat-number {
        font-size: 2.75rem;
    }

    /* Enhanced hover effects for desktop */
    .feature-card:hover {
        transform: translateY(-8px);
    }

    .course-card:hover {
        transform: translateY(-8px);
    }

    .btn:hover {
        transform: translateY(-2px);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-section {
        padding: 120px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 3rem;
    }
}

/* ====================
   ACCESSIBILITY IMPROVEMENTS
   ==================== */

@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 support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid;
        border-color: currentColor;
    }

    .btn {
        border: 2px solid;
    }
}

/* ====================
   MOBILE TOUCH INTERACTIONS & FORM ENHANCEMENTS
   ==================== */

/* Touch feedback for mobile elements */
.touch-active {
    background-color: rgba(0, 123, 255, 0.1) !important;
    transform: scale(0.98);
    transition: all 0.15s ease;
}

.touch-active.btn {
    background-color: #0056b3 !important;
}

/* Mobile form inputs - Prevent iOS zoom */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="number"],
textarea,
select {
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
}

/* Enhanced form validation for mobile */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73L.82 5.25a.5.5 0 0 1 .7-.7l1.48 1.48 3.48-3.48a.5.5 0 1 1 .7.7L2.3 6.73z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus {
    color: #007bff;
    outline: none;
}

/* Checkbox enhancements for mobile */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 8px;
    margin: -8px; /* Compensate for padding */
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 20px;
    min-height: 20px;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background-color: #007bff;
    border-color: #007bff;
}

.checkbox-wrapper input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input:focus ~ .checkmark {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Mobile select dropdowns */
select.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Mobile button enhancements */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading button states */
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile alert enhancements */
.mobile-alert {
    position: fixed;
    top: 20px;
    left: 10px;
    right: 10px;
    z-index: 1060;
    max-width: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Enhanced mobile card interactions */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile scrollbar improvements */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile focus indicators */
*:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .btn,
    .nav-link,
    .dropdown-item,
    .form-control,
    .card {
        min-height: 44px;
        min-width: 44px;
    }

    .close,
    .btn-close {
        width: 44px;
        height: 44px;
        padding: 14px;
    }

    /* Larger checkboxes on mobile */
    .checkmark {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }

    .checkbox-wrapper input:checked ~ .checkmark::after {
        left: 8px;
        top: 3px;
    }
}

/* Prevent iOS input zoom */
@media screen and (max-width: 767px) {
    input[type="email"],
    input[type="password"],
    input[type="text"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 12px 16px !important;
        height: auto !important;
    }

    /* Make form inputs more touch-friendly */
    .form-control,
    .form-select {
        padding: 12px 16px !important;
        border-radius: 8px !important;
        border: 2px solid #e9ecef !important;
    }

    .btn {
        padding: 12px 24px !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }
}

/* ====================
   PRINT STYLES
   ==================== */

@media print {
    .navbar,
    .hero-section,
    .carousel,
    .footer {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    .btn {
        background: #fff;
        border: 1px solid #000;
        color: #000;
    }
}
