/*
 * GreenFutureUAE - Modern CSS Stylesheet
 * A fresh, clean design for sustainability education
 */

/* ============================
   CSS Variables
============================ */
:root {
    --primary-green: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --accent-green: #81C784;
    --earth-brown: #795548;
    --sky-blue: #03A9F4;
    --ocean-blue: #0288D1;
    --sun-yellow: #FFC107;
    --coral: #FF7043;
    
    --text-dark: #212121;
    --text-muted: #666666;
    --text-light: #9E9E9E;
    
    --bg-white: #FFFFFF;
    --bg-light: #F5F7F5;
    --bg-cream: #FAFAFA;
    --bg-dark: #1A1A2E;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
}

/* ============================
   Base Styles
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================
   Top Bar
============================ */
.top-bar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-green) 100%);
    padding: 8px 0;
    font-size: 14px;
}

.top-bar a {
    color: rgba(255,255,255,0.9);
    margin-right: 20px;
}

.top-bar a:hover {
    color: #fff;
}

.top-bar-right {
    text-align: right;
}

.top-bar-right a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin-left: 8px;
}

.top-bar-right a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ============================
   Main Navigation
============================ */
.main-nav {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
    transition: var(--transition);
}

.main-nav.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-dark) !important;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.brand-text {
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    padding: 10px 16px !important;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-green) !important;
    background: rgba(46, 125, 50, 0.08);
}

.navbar-nav .nav-link i {
    font-size: 0.9em;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 10px 0;
    margin-top: 10px;
}

.dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-green);
}

.dropdown-item i {
    width: 20px;
    color: var(--primary-green);
}

/* User Dropdown */
.user-dropdown .nav-link {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-green);
    margin-right: 8px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info strong {
    display: block;
    font-size: 14px;
}

.user-info small {
    font-size: 12px;
}

.progress-info small {
    display: block;
    font-size: 12px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
}

.auth-buttons .btn {
    border-radius: 20px;
    font-weight: 500;
}

/* ============================
   Hero Section
============================ */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, #E8F5E9 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: url('../img/leaf-pattern.png') repeat;
    opacity: 0.03;
    transform: rotate(-15deg);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.hero-title .highlight {
    color: var(--primary-green);
    position: relative;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-buttons .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 30px;
    margin-right: 15px;
    margin-bottom: 10px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 50px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-green);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-image {
    position: relative;
    z-index: 1;
}

.hero-image img {
    max-width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ============================
   Section Styles
============================ */
.section {
    padding: 80px 0;
}

.section-light {
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    margin-bottom: 15px;
}

.section-title p {
    max-width: 600px;
    margin: 0 auto;
}

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary-green);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ============================
   Cards
============================ */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: var(--bg-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 25px;
}

.card-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Module Cards */
.module-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.module-number {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 2;
}

.module-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.module-status.completed {
    background: var(--primary-green);
    color: white;
}

.module-status.in-progress {
    background: var(--sun-yellow);
    color: var(--text-dark);
}

.module-status.locked {
    background: var(--text-light);
    color: white;
}

/* ============================
   Buttons
============================ */
.btn {
    font-weight: 500;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-success:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-success {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-outline-success:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* ============================
   Forms
============================ */
.form-control {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-check-input:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

/* ============================
   Progress Bar
============================ */
.progress {
    height: 10px;
    border-radius: 10px;
    background: var(--bg-light);
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-green));
}

/* ============================
   Course Progress Widget
============================ */
.progress-widget {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 30px;
    color: white;
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.progress-percentage {
    font-size: 2rem;
    font-weight: 700;
}

/* ============================
   Quiz Styles
============================ */
.quiz-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.quiz-option {
    display: block;
    padding: 15px 20px;
    margin-bottom: 12px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-option:hover {
    border-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.1);
}

.quiz-option.correct {
    border-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.15);
}

.quiz-option.incorrect {
    border-color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

/* ============================
   Footer
============================ */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
}

.footer-main {
    padding: 60px 0 40px;
}

.footer-widget {
    margin-bottom: 30px;
}

.footer-title {
    color: white;
    font-family: var(--font-primary);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-green);
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.footer-contact i {
    width: 20px;
    margin-right: 12px;
    color: var(--accent-green);
    margin-top: 3px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 10px;
    color: white;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary-green);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: rgba(255,255,255,0.7);
}

.footer-bottom a:hover {
    color: white;
}

/* ============================
   Back to Top
============================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* ============================
   Page Headers
============================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    padding: 80px 0 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('../img/pattern.png') repeat;
    opacity: 0.05;
}

.page-header h1 {
    color: white;
    margin-bottom: 15px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    color: rgba(255,255,255,0.7);
}

.breadcrumb-item a {
    color: rgba(255,255,255,0.9);
}

.breadcrumb-item.active {
    color: white;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.5);
}

/* ============================
   Auth Pages
============================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
    background: var(--bg-light);
}

.auth-card {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #E0E0E0;
}

.auth-divider span {
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================
   Alert Styles
============================ */
.alert {
    border-radius: var(--radius-md);
    border: none;
}

.alert-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary-dark);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #C62828;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #F57C00;
}

.alert-info {
    background: rgba(3, 169, 244, 0.1);
    color: var(--ocean-blue);
}

/* ============================
   Utilities
============================ */
.text-green {
    color: var(--primary-green) !important;
}

.bg-green {
    background: var(--primary-green) !important;
}

.bg-gradient-green {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark)) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ============================
   Animations
============================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ============================
   Responsive Styles
============================ */
@media (max-width: 991.98px) {
    .hero {
        padding: 60px 0;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .hero-image {
        margin-top: 40px;
    }
    
    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: var(--radius-md);
        margin-top: 15px;
        box-shadow: var(--shadow-lg);
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .auth-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    
    .section {
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .top-bar-left,
    .top-bar-right {
        text-align: center;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom .col-md-6:last-child {
        margin-top: 10px;
    }
}

@media (max-width: 575.98px) {
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .stat-item {
        flex: 0 0 50%;
    }
    
    .auth-card {
        padding: 25px;
        margin: 0 15px;
    }
}
