/* Core Variables */
:root {
    --primary-color: #28a745;
    --secondary-color: #218838;
    --dark-color: #333;
    --light-color: #f4f4f9;
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

/* Header */
header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2rem); /* Responsive font size */
    font-weight: 700;
    text-transform: uppercase;
}

header p {
    font-size: clamp(0.9rem, 3vw, 1rem);
    margin: 0.8rem auto 0;
    opacity: 0.9;
    max-width: 90%;
}

/* Navigation */
nav {
    background: rgba(40, 167, 69, 0.95);
    padding: 0.8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 500;
    display: block;
    text-align: center;
    font-size: 0.9rem;
}

nav a:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Course Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.course-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.course-info {
    padding: 1rem;
}

.course-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.course-price {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Services Section */
.services {
    text-align: center;
    margin: 2rem 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.service-card {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem 1rem;
    margin-top: 2.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.social-links {
    margin-top: 1.2rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.social-links .btn {
    background: white;
    color: var(--primary-color);
    margin: 0 0.3rem;
    min-width: 40px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Course Details */
.course-header {
    padding: 1.2rem 1rem;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.course-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 1rem;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.course-container {
    padding: 1.2rem 1rem;
}

.course-details {
    background: #fff;
    border-radius: 8px;
    padding: 1.2rem 1rem;
    margin-bottom: 1rem;
}

.course-meta {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-wrapper {
    margin: 1.2rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.course-actions {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.progress-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.progress-form input[type="number"] {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    nav ul {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .courses-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .course-card img {
        height: 150px;
    }
    
    .course-meta {
        gap: 0.8rem;
    }
    
    .course-actions {
        gap: 0.6rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 600px) {
    header {
        padding: 1rem;
    }
    
    nav ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    nav a {
        white-space: nowrap;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .course-meta {
        flex-direction: column;
    }
    
    .course-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-form input[type="number"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    nav {
        padding: 0.6rem 0.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.6rem;
        margin-bottom: 0.5rem;
    }
    
    .social-links {
        flex-direction: row;
        justify-content: center;
    }
    
    .social-links .btn {
        margin: 0 0.3rem;
        padding: 0.5rem;
        min-width: 36px;
    }
    
    .course-card img {
        height: 130px;
    }
}

/* Touch target improvements */
a, button, .btn, input[type="submit"], input[type="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on input focus */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}