/**
 * MT Learning - Main Stylesheet
 * Based on demo.html design
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0071dc;
    --primary-dark: #005bb5;
    --secondary: #6cc24a;
    --accent: #ffa726;
    --dark: #1a1a1a;
    --text: #333;
    --text-light: #666;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Prompt', sans-serif;
    line-height: 1.6;
    color: var(--text);
    padding-bottom: 70px;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    margin: 5px 0;
    transition: 0.3s;
}

.navbar-menu {
    display: none;
}

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--primary);
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s;
}

.navbar-nav a:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 220, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 113, 220, 0.4);
}

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

.btn-secondary:hover {
    background: #5ab038;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-login {
    background: var(--primary);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
    font-size: 0.875rem;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-register {
    background: var(--secondary);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: 'Prompt', sans-serif;
}

.btn-subscribe {
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
}

.btn-block {
    width: 100%;
    display: block;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

.dropdown-menu .divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--secondary);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--accent);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f0fe 100%);
    padding: 2rem 1rem 3rem;
}

.hero-content {
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--dark);
}

.hero-subtitle {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Features Section */
.features {
    background: #fff;
    padding: 3rem 1rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.feature-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 0.375rem;
    color: var(--dark);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Categories Section */
.categories {
    padding: 3rem 1rem;
    background: var(--bg-light);
}

.categories-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 2rem auto 0;
}

.category-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.category-card p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Courses Section */
.featured-courses,
.courses-page {
    padding: 3rem 1rem;
    background: #fff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.courses-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.course-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.course-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.course-thumbnail-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
}

.course-content {
    padding: 1.25rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.course-category {
    display: inline-block;
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.course-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-level-beginner {
    background: #d1fae5;
    color: #065f46;
}

.course-level-intermediate {
    background: #fef3c7;
    color: #92400e;
}

.course-level-advanced {
    background: #fee2e2;
    color: #991b1b;
}

.course-title {
    font-size: 1.0625rem;
    color: var(--dark);
    margin-bottom: 0.625rem;
    line-height: 1.4;
    font-weight: 600;
}

.course-title a {
    color: var(--dark);
    text-decoration: none;
}

.course-title a:hover {
    color: var(--primary);
}

.course-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.course-author {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.course-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.course-free {
    color: var(--secondary);
}

/* Stats Section */
.stats {
    padding: 3rem 1rem;
    background: var(--bg-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 1rem;
    color: #fff;
    text-align: center;
}

.cta-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--dark);
    color: #fff;
    padding: 2.5rem 1rem 1.5rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto 2rem;
}

.footer-col h3,
.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact {
    list-style: none;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

.footer-contact li {
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 0.625rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.8125rem;
}

.footer-bottom a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 0.625rem 0;
    z-index: 1000;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.6875rem;
    transition: color 0.2s;
    padding: 0.375rem 1rem;
}

.mobile-nav-item .icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Prompt', sans-serif;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 220, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Auth Pages */
.auth-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
    background: var(--bg-light);
}

.auth-box {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.auth-header p {
    color: var(--text-light);
}

.auth-form {
    margin-bottom: 1.5rem;
}

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

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    background: #fff;
    padding: 0 1rem;
    position: relative;
    color: var(--text-light);
    font-size: 0.875rem;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
}

.btn-social:hover:not(:disabled) {
    background: var(--bg-light);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-social .icon {
    font-size: 1.25rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--secondary);
    color: #fff;
}

.badge-primary {
    background: var(--primary);
    color: #fff;
}

.badge-warning {
    background: var(--accent);
    color: #fff;
}

/* Responsive: Tablet */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .hero {
        padding: 3rem 1.5rem 4rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: row;
        gap: 1rem;
    }

    .btn-primary {
        width: auto;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 2.25rem;
    }

    .mobile-nav {
        display: none;
    }
}

/* Responsive: Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .navbar-menu {
        display: block;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .hero-title {
        font-size: 3rem;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2.5rem;
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .courses-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Custom Utility Classes for Hero Buttons */
.bg-size-200 {
    background-size: 200%;
}

.bg-pos-0 {
    background-position: 0%;
}

.bg-pos-100 {
    background-position: 100%;
}
