/* =============================================
   Diploma Engineer - Production Stylesheet
   Mobile-First Responsive Design
   ============================================= */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #1e293b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --dark-text: #0f172a;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================
   Header & Navigation - Mobile Optimized
   ============================================= */
.main-header {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem;
    position: relative;
}

.navbar-brand h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.navbar-brand a {
    text-decoration: none;
    transition: opacity 0.2s;
}

.navbar-brand a:hover {
    opacity: 0.85;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navbar Collapse */
.navbar-collapse {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
}

.navbar-menu li a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9375rem;
}

.navbar-menu li a:hover,
.navbar-menu li a.active {
    color: var(--primary-color);
    background: #eff6ff;
}

.navbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* =============================================
   Buttons - Production Ready
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* =============================================
   Hero Section - Modern Design
   ============================================= */
.hero {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.375rem);
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

.feature-item {
    background: rgba(255,255,255,0.12);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-item p {
    opacity: 0.92;
    line-height: 1.6;
}

/* =============================================
   Sections - Modern Layout
   ============================================= */
.courses-section,
.why-choose-us,
.blog-section,
.cta-section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

/* =============================================
   Course Cards - Enhanced Design
   ============================================= */
.courses-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.course-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: #fff;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.discount-countdown {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #ef4444;
    color: #fff;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.35);
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 12;
    min-width: 170px;
}

.discount-countdown .discount-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.9;
}

.discount-countdown .countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.discount-countdown .time-seg {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 0.4rem 0.3rem;
    text-align: center;
}

.discount-countdown .time-num {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.discount-countdown .time-unit {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.9;
}

.discount-countdown.compact {
    position: static;
    box-shadow: none;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    min-width: 0;
    width: fit-content;
    margin-bottom: 1rem;
}

.discount-countdown-inline {
    margin: 0 1.5rem 1.25rem;
    flex: 0 0 auto;
}

.course-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.course-price-row .course-pricing {
    padding: 0 0 0 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.course-price-row .discount-countdown-inline {
    margin: 0 1.5rem 1.25rem 0;
}

@media (max-width: 640px) {
    .course-price-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .course-price-row .course-pricing {
        padding: 0 1.5rem;
        margin-bottom: 0.75rem;
    }
    .course-price-row .discount-countdown-inline {
        margin: 0 1.5rem 1.25rem;
    }
}

@media (max-width: 640px) {
    .discount-countdown {
        min-width: 150px;
        padding: 0.5rem 0.65rem;
    }
    .discount-countdown .countdown-timer {
        gap: 0.25rem;
    }
    .discount-countdown .time-num {
        font-size: 0.9rem;
    }
}

.course-card h3 {
    padding: 1.5rem 1.5rem 0.75rem;
    font-size: 1.375rem;
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1.4;
}

.course-card p {
    padding: 0 1.5rem;
    color: var(--light-text);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    flex: 1;
}

.course-meta {
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--light-text);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.course-pricing {
    padding: 0 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: var(--light-text);
    font-size: 0.9375rem;
}

.discounted-price,
.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.course-card .btn {
    margin: 1.5rem;
    margin-top: 0;
}

/* =============================================
   Why Choose Us Section
   ============================================= */
.why-choose-us {
    background: var(--light-bg);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.benefit-item {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.benefit-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.benefit-item p {
    color: var(--light-text);
}

/* =============================================
   Blog Section
   ============================================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
}

.blog-category {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.blog-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.blog-card h3 a {
    text-decoration: none;
    color: var(--secondary-color);
}

.blog-card h3 a:hover {
    color: var(--primary-color);
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

/* =============================================
   CTA Section
   ============================================= */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* =============================================
   Footer
   ============================================= */
.main-footer {
    background: var(--secondary-color);
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: 1rem;
}

.footer-col p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-col a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* =============================================
   Utilities
   ============================================= */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* =============================================
   Responsive Design - Production Ready
   ============================================= */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .courses-carousel {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablets */
@media (max-width: 768px) {
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Mobile Navigation */
    .navbar-collapse {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2rem;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .navbar-collapse.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .navbar-menu li {
        width: 100%;
    }
    
    .navbar-menu li a {
        display: block;
        padding: 1rem 1.5rem;
        color: #ffffff;
        font-size: 1.125rem;
        border-radius: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-menu li a:hover,
    .navbar-menu li a.active {
        background: rgba(59, 130, 246, 0.2);
        color: #ffffff;
    }
    
    .navbar-actions {
        width: 100%;
        flex-direction: column;
        margin-top: 1.5rem;
        gap: 0.75rem;
    }
    
    .navbar-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
    }
    
    .hero {
        padding: 3.5rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .courses-carousel,
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .courses-section,
    .why-choose-us,
    .blog-section,
    .cta-section {
        padding: 3.5rem 0;
    }
    
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2.5rem;
    }
    
    .feature-item {
        padding: 1.5rem;
    }
    
    .courses-section,
    .why-choose-us,
    .blog-section,
    .cta-section {
        padding: 2.5rem 0;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .courses-carousel {
        gap: 1.5rem;
    }
    
    .course-card h3 {
        font-size: 1.25rem;
        padding: 1.25rem 1.25rem 0.5rem;
    }
    
    .course-card p {
        padding: 0 1.25rem;
        font-size: 0.9375rem;
    }
    
    .course-meta,
    .course-pricing {
        padding: 0 1.25rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cta-section h2 {
        font-size: 1.75rem;
    }
    
    .cta-section p {
        font-size: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .navbar-brand h1 {
        font-size: 1.375rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-buttons,
    .cta-section,
    .main-footer {
        display: none !important;
    }
    
    .hero {
        background: none;
        color: #000;
    }
    
    .course-card,
    .section-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-success {
        border: 2px solid currentColor;
    }
    
    .course-card,
    .section-card {
        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;
    }
}
