/* 
 * -------------------------------------------------------------
 * Beijing Yiruyi Consulting Services Co., Ltd. - Main Stylesheet
 * Theme: Ruby Red & Premium Professional (Red dominant)
 * -------------------------------------------------------------
 */

:root {
    /* Color Palette - Red Theme */
    --primary-red: #8B1A1A; /* Requested Red */
    --primary-red-light: #A52A2A;
    --primary-red-dark: #5C0E0E;
    
    --accent-gold: #D4AF37; /* Gold accent for premium feel */
    --accent-gold-light: #F3E5AB;

    --text-main: #2C3E50;
    --text-muted: #64748B;
    --text-light: #F8FAFC;
    
    --bg-main: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-dark: #1E293B;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(139, 26, 26, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(139, 26, 26, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(139, 26, 26, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(139, 26, 26, 0.4);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-accent {
    color: var(--primary-red);
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--text-light);
    color: var(--text-light);
}

.btn-outline:hover {
    background-color: var(--text-light);
    color: var(--primary-red-dark);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
    background: transparent;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-light);
    transition: var(--transition);
}

.logo-accent {
    color: var(--primary-red-light);
}

header.scrolled .logo-text {
    color: var(--primary-red-dark);
}

header.scrolled .logo-accent {
    color: var(--primary-red);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-red-light);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

header.scrolled .nav-link {
    color: var(--text-main);
}
header.scrolled .nav-link::after {
    background-color: var(--primary-red);
}
header.scrolled .nav-link:hover {
    color: var(--primary-red);
}

.btn-contact {
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
}
.btn-contact::after {
    display: none;
}
.btn-contact:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white !important;
}
header.scrolled .btn-contact {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}
header.scrolled .mobile-menu-btn {
    color: var(--primary-red-dark);
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    background-image: url('../assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-light);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
}

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

/* About Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.about-features {
    margin-top: 30px;
}

.about-features li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-main);
}

.about-features i {
    color: var(--primary-red);
    font-size: 1.2rem;
}

.about-image {
    flex: 1;
    position: relative;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 30px;
}

.image-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-left: 4px solid var(--primary-red);
}

.stats-box {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stats-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stats-box h3 {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 5px;
}
.stats-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}
.stats-box:first-child {
    grid-column: 1 / -1;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid transparent;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--primary-red);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(200, 16, 46, 0.1);
    color: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .icon-wrapper {
    background: var(--primary-red);
    color: white;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.read-more {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more i {
    transition: var(--transition);
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Why Us Timeline */
.why-us-content {
    max-width: 800px;
    margin: 0 auto;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(200, 16, 46, 0.2);
}

.timeline-item {
    display: flex;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 0 0 5px white, var(--shadow-sm);
}

.timeline-content {
    margin-left: 30px;
    padding: 30px;
    width: 100%;
    border-left: 4px solid var(--primary-red);
}

.timeline-content h3 {
    color: var(--primary-red-dark);
    margin-bottom: 10px;
}
.timeline-content p {
    color: var(--text-muted);
}

/* Contact Section */
.contact-wrapper {
    display: flex;
    gap: 60px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.contact-info {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
    padding: 50px;
}

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}
.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-top: 5px;
}

.info-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--accent-gold-light);
}

.info-item p {
    opacity: 0.9;
}

.contact-form {
    flex: 1.5;
    padding: 50px;
}

.form-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

input, textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-light);
}
.full-width {
    margin-bottom: 20px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    background: white;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding-top: 80px;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand p {
    margin-top: 20px;
    margin-bottom: 20px;
    color: #94A3B8;
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}
.social-links a:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}
.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-red);
}

.footer-links ul li {
    margin-bottom: 12px;
}
.footer-links ul a {
    color: #94A3B8;
}
.footer-links ul a:hover {
    color: var(--primary-red-light);
    padding-left: 5px;
}

.footer-bottom {
    background: #0F172A;
    padding: 20px 0;
    text-align: center;
    color: #64748B;
    font-size: 0.9rem;
}
.footer-bottom a {
    color: #94A3B8;
}
.footer-bottom a:hover {
    color: white;
}


/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.right {
    transform: translateX(50px);
}
.scroll-reveal.right.visible {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero h1 { font-size: 3rem; }
    .about-container { flex-direction: column; }
    .contact-wrapper { flex-direction: column; gap: 0; }
    .footer-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
    }
    .nav-links.active {
        left: 0;
    }
    .nav-link { color: var(--text-main); font-size: 1.2rem; }
    .mobile-menu-btn { display: block; }
    header.scrolled { padding: 20px 0; }
    .footer-container { grid-template-columns: 1fr; }
    .form-group { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Certificate Card Grid & Layout
   ========================================================================== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 991px) {
    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .cert-grid {
        grid-template-columns: 1fr;
    }
}

/* Center the 7th item when it stands alone in the grid */
@media (min-width: 992px) {
    .cert-grid > :last-child:nth-child(3n - 2) {
        grid-column: 2;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .cert-grid > :last-child:nth-child(2n - 1) {
        grid-column: 1 / span 2;
        max-width: calc(50% - 15px);
        margin: 0 auto;
        width: 100%;
    }
}

.cert-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(139, 26, 26, 0.05);
    cursor: pointer;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 26, 26, 0.15);
}

.cert-img-wrapper {
    width: 100%;
    height: 250px;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.cert-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cert-card:hover .cert-img-wrapper img {
    transform: scale(1.06);
}

.cert-title {
    margin-top: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    transition: var(--transition);
}

.cert-card:hover .cert-title {
    color: var(--primary-red);
}

/* ==========================================================================
   Premium Lightbox Modal
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85); /* Slate-900 with alpha */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox Toolbar */
.lightbox-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 2010;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.lightbox-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: scale(1.05);
}

/* Lightbox Content Container */
.lightbox-content {
    position: relative;
    width: 90%;
    height: 75%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
}

.lightbox-img-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: transform 0.15s ease-out; /* Smooth dragging */
}

.lightbox-img-container.dragging {
    cursor: grabbing;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.2, 1); /* Smooth scaling */
    pointer-events: none; /* Let container handle events */
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    width: 50px;
    height: 60px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 2010;
}

.lightbox-nav:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Lightbox Caption */
.lightbox-caption {
    position: absolute;
    bottom: 30px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 8px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2010;
}

/* Zoom Level Indicator */
.zoom-indicator {
    position: absolute;
    bottom: 80px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2010;
}

.zoom-indicator.show {
    opacity: 1;
}

/* Responsive adjustments for Lightbox */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 50px;
        font-size: 1.2rem;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-toolbar { top: 15px; right: 15px; }
}
