/**
 * Home Page Styles (Front Page)
 *
 * Hero section, Enhanced Features section, Products section,
 * and front-page specific responsive styles.
 * This file is loaded conditionally on front page only for performance.
 *
 * @package MG_Red_Line
 * @version 2.2.0
 */

/* === HERO SECTION === */
.mgredline-hero {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2d2d2d 50%, var(--primary-color) 100%);
    color: var(--white);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.mgredline-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 200"><polygon fill="%23ffffff" fill-opacity="0.05" points="0,0 1000,0 1000,100 0,200"/></svg>');
    background-size: cover;
    background-position: center;
}

.mgredline-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.mgredline-hero-text h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.mgredline-hero-text .hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-weight: 300;
}

.mgredline-hero-text p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.mgredline-hero-buttons {
    display: flex;
    gap: 20px;
}

.mgredline-hero-image {
    position: relative;
}

.product-mockup {
    width: 400px;
    height: 400px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
    text-align: center;
}

.product-mockup i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.product-mockup span {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === ENHANCED FEATURES SECTION === */
.mgredline-features-enhanced {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(135deg, var(--dark-color) 0%, #2d2d2d 100%);
    overflow: hidden;
}

/* Background Effects */
.features-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(220, 53, 69, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(220, 53, 69, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: mgredlineFloat 6s ease-in-out infinite;
}

.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 60%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { top: 80%; left: 20%; animation-delay: 4s; }
.particle:nth-child(4) { top: 30%; left: 90%; animation-delay: 1s; }
.particle:nth-child(5) { top: 70%; left: 60%; animation-delay: 3s; }

@keyframes mgredlineFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Enhanced Header */
.mgredline-features-header-enhanced {
    position: relative;
    text-align: center;
    margin-bottom: 80px;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 50px;
    padding: 8px 20px;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.badge-icon {
    font-size: 14px;
    animation: mgredlinePulse 2s infinite;
}

@keyframes mgredlinePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.mgredline-features-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.title-highlight {
    color: var(--primary-color);
    position: relative;
}

.title-main {
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-underline {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto 30px;
    border-radius: 2px;
    overflow: hidden;
}

.underline-animated {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    border-radius: 2px;
    animation: mgredlineSlideIn 2s ease-out;
}

@keyframes mgredlineSlideIn {
    0% { width: 0%; }
    100% { width: 100%; }
}

.mgredline-features-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 0 auto 50px;
    line-height: 1.6;
}

/* Stats Counter */
.mgredline-stats-counter {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Enhanced Features Grid */
.mgredline-features-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
    margin-bottom: 80px;
}

/* Feature Cards */
.mgredline-feature-item-enhanced {
    position: relative;
    min-height: 300px;
    height: auto;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.feature-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 30px 25px;
    transition: all 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mgredline-feature-item-enhanced:hover .feature-card-inner {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(220, 53, 69, 0.3);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* Feature Highlight */
.feature-highlight .feature-card-inner {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(255, 107, 122, 0.05) 100%);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.highlight-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Icon Wrapper */
.feature-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    border-radius: 50%;
    opacity: 0.1;
    transition: var(--transition);
}

.mgredline-feature-item-enhanced:hover .icon-background {
    opacity: 0.2;
    transform: scale(1.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    z-index: 2;
    transition: var(--transition);
}

.mgredline-feature-item-enhanced:hover .feature-icon {
    transform: scale(1.1);
    color: #ff6b7a;
}

.icon-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: mgredlineIconPulse 2s infinite;
}

@keyframes mgredlineIconPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Feature Content */
.feature-content {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 15px;
    line-height: 1.3;
}

.feature-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.feature-metrics {
    margin-top: auto;
    padding-top: 15px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Temperature Scale */
.temperature-scale {
    margin-top: 15px;
}

.temp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.temp-indicator {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #28a745 50%, #ffc107 80%, #dc3545 100%);
    border-radius: 4px;
    animation: mgredlineTempSlide 3s ease-in-out infinite;
}

@keyframes mgredlineTempSlide {
    0%, 100% { width: 0%; }
    50% { width: 100%; }
}

.temp-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Feature Overlay */
.feature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    opacity: 0;
    border-radius: var(--border-radius);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mgredline-feature-item-enhanced:hover .feature-overlay {
    opacity: 0.03;
}

/* Technology Showcase */
.mgredline-technology-showcase {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 40px 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
    max-width: 100%;
    overflow: hidden;
}

/* Technology showcase text - make visible on dark background */
.mgredline-technology-showcase h2,
.mgredline-technology-showcase .technology-text h3,
.core-technology h2,
.core-technology .section-header h2,
.core-technology .section-header {
    color: var(--white) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.mgredline-technology-showcase p,
.mgredline-technology-showcase .technology-text p,
.mgredline-technology-showcase .technology-text,
.core-technology p,
.core-technology .section-header p,
.section-header h2,
.section-header p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.tech-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.molecule-animation {
    position: relative;
    width: 200px;
    height: 200px;
}

.atom {
    position: relative;
    width: 100%;
    height: 100%;
}

.nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), #ff6b7a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

.electron-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 80px;
    height: 80px;
    animation: mgredlineRotate 4s linear infinite;
}

.orbit-2 {
    width: 120px;
    height: 120px;
    animation: mgredlineRotate 6s linear infinite reverse;
}

.orbit-3 {
    width: 160px;
    height: 160px;
    animation: mgredlineRotate 8s linear infinite;
}

.electron {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.7);
}

@keyframes mgredlineRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.tech-content h3 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.3;
}

.tech-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.tech-button {
    position: relative;
    overflow: hidden;
}

.tech-button:hover i:last-child {
    transform: translateX(5px);
}

/* Animation classes for WordPress */
.mgredline-feature-item-enhanced {
    animation: mgredlineFadeInUp 0.6s ease forwards;
}

.mgredline-feature-item-enhanced:nth-child(1) { animation-delay: 0.1s; }
.mgredline-feature-item-enhanced:nth-child(2) { animation-delay: 0.2s; }
.mgredline-feature-item-enhanced:nth-child(3) { animation-delay: 0.3s; }
.mgredline-feature-item-enhanced:nth-child(4) { animation-delay: 0.4s; }
.mgredline-feature-item-enhanced:nth-child(5) { animation-delay: 0.5s; }
.mgredline-feature-item-enhanced:nth-child(6) { animation-delay: 0.6s; }
.mgredline-feature-item-enhanced:nth-child(7) { animation-delay: 0.7s; }

@keyframes mgredlineFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation fix for loaded state */
.loaded .mgredline-features-header-enhanced {
    opacity: 1;
    transform: translateY(0);
}

.loaded .mgredline-feature-item-enhanced {
    opacity: 1;
    transform: translateY(0);
}

/* Delay animations for stagger effect */
.mgredline-feature-item-enhanced:nth-child(1) { transition-delay: 0.1s; }
.mgredline-feature-item-enhanced:nth-child(2) { transition-delay: 0.2s; }
.mgredline-feature-item-enhanced:nth-child(3) { transition-delay: 0.3s; }
.mgredline-feature-item-enhanced:nth-child(4) { transition-delay: 0.4s; }
.mgredline-feature-item-enhanced:nth-child(5) { transition-delay: 0.5s; }
.mgredline-feature-item-enhanced:nth-child(6) { transition-delay: 0.6s; }
.mgredline-feature-item-enhanced:nth-child(7) { transition-delay: 0.7s; }

/* === PRODUCTS SECTION === */
.mgredline-products {
    padding: 100px 0;
    background: var(--white);
}

.mgredline-products-header {
    text-align: center;
    margin-bottom: 60px;
}

.mgredline-products-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.mgredline-products-header p {
    font-size: 1.2rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}


/* === RESPONSIVE STYLES FOR FRONT PAGE === */

@media (max-width: 1024px) {
    .mgredline-features-title {
        font-size: 3rem;
    }

    .mgredline-features-grid-enhanced {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    /* Technology showcase - flex on tablet */
    .mgredline-technology-showcase {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 30px 25px;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
    }

    .molecule-animation {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .tech-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .tech-content {
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .tech-content h3 {
        font-size: 2rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Hero content - flex on mobile */
    .mgredline-hero-content {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .mgredline-hero-text h1 {
        font-size: 2.5rem;
    }

    .mgredline-hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .mgredline-features-enhanced {
        padding: 60px 0;
    }

    .mgredline-features-title {
        font-size: 2.5rem;
    }

    .mgredline-features-grid-enhanced {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mgredline-feature-item-enhanced {
        min-height: 280px;
    }

    .feature-card-inner {
        padding: 25px 20px;
        min-height: 280px;
    }

    .mgredline-stats-counter {
        flex-direction: column;
        gap: 30px;
    }

    /* Technology showcase - flex on mobile */
    .mgredline-technology-showcase {
        display: flex;
        flex-direction: column;
        padding: 25px 20px;
        gap: 25px;
        margin: 0 auto;
        text-align: center;
        justify-content: center;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    .molecule-animation {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .tech-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .tech-content {
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .tech-content h3 {
        font-size: 1.8rem;
        text-align: center;
    }

    .tech-content p {
        font-size: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .mgredline-features-title {
        font-size: 2rem;
    }

    .feature-card-inner {
        padding: 20px 15px;
        min-height: 260px;
    }

    .feature-title {
        font-size: 1.2rem;
    }

    .feature-description {
        font-size: 0.85rem;
    }

    /* Technology showcase - smaller on small mobile */
    .mgredline-technology-showcase {
        display: flex;
        flex-direction: column;
        padding: 20px 15px;
        margin: 0 auto;
        border-radius: 12px;
        text-align: center;
        justify-content: center;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    .molecule-animation {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .tech-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .tech-content {
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .tech-content h3 {
        font-size: 1.6rem;
        text-align: center;
    }

    .tech-content p {
        text-align: center;
    }

    .mgredline-features-subtitle {
        font-size: 1.1rem;
    }

    .tech-button {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    .mgredline-feature-item-enhanced {
        opacity: 1 !important;
        transform: none !important;
    }

    .mgredline-features-header-enhanced {
        opacity: 1 !important;
        transform: none !important;
    }

    .floating-particles,
    .particle {
        animation: none !important;
    }

    .molecule-animation,
    .electron-orbit,
    .nucleus,
    .electron {
        animation: none !important;
    }

    .badge-icon {
        animation: none !important;
    }

    .icon-pulse {
        animation: none !important;
    }

    .temp-indicator {
        animation: none !important;
        width: 100% !important;
    }

    .underline-animated {
        animation: none !important;
        width: 100% !important;
    }
}
