/* USMF - Layout Fixes & Stabilization */

/* Prevent layout shifting */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Fix Hero Section */
.hero-modern {
    position: relative;
    min-height: 100vh;
    padding-top: 120px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero-video {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-bg-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.85) 0%, rgba(59, 130, 246, 0.75) 50%, rgba(147, 197, 253, 0.65) 100%);
    pointer-events: none;
}

/* Fix container alignment */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Fix Hero Layout */
.hero-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Stabilize buttons */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Fix Info Card Position */
.info-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    max-width: 100%;
}

/* Fix Trust Strip */
.trust-strip {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

.trust-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: #334155;
}

/* Fix Section Spacing */
section {
    position: relative;
    padding: 60px 0;
    overflow: hidden;
}

.hero-modern + section {
    margin-top: 0;
}

/* Fix CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.cta-content {
    text-align: center;
    color: white;
}

.cta-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

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

/* Fix Stats Grid */
.stats {
    background: #f8fafc;
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

/* Fix Gallery */
.gallery-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.gallery-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 350px;
}

.card-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

/* Fix Program Cards */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.program-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Fix Forms */
.application-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Fix WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: scale(1.1);
}

/* Fix Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 100px;
    width: 45px;
    height: 45px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #1e40af;
    transform: translateY(-3px);
}

/* Fix Footer */
.footer {
    background: #111827;
    color: white;
    padding: 60px 0 20px;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    .hero-modern {
        min-height: auto;
        padding: 100px 0 40px;
    }
    
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .hero-main-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-cta {
        width: 100%;
        max-width: 300px;
    }
    
    .info-card {
        margin-top: 20px;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 80px;
        width: 40px;
        height: 40px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-layout {
        gap: 30px;
    }
    
    .hero-main-title {
        font-size: 3rem;
    }
    
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Fix z-index issues */
.header-modern {
    z-index: 1000;
}

.hero-modern {
    z-index: 1;
}

.notification {
    z-index: 9999;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
    transition: all 0.3s ease;
}

/* Ensure images don't cause layout shift */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix section overlaps */
section + section {
    margin-top: 0;
}

/* Ensure proper stacking context */
.hero-modern,
.cta-banner,
.stats,
.gallery-modern,
.programs,
.about,
.why-moldova,
.application,
.urgent-cta,
.contact,
.faq,
.footer {
    position: relative;
    z-index: 1;
}