/* ============================================
   NewInno Website - Cleaned & Re-commented CSS
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --accent-color: #ffc107;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ---------- Global Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ---------- Navigation ---------- */
.navbar {
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Underline hover effect */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

/* ---------- Hero Section ---------- */
.hero-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 680px;
    display: flex;
    align-items: center;
    padding-top: 76px; /* offset for fixed navbar */
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* ---------- Generic Sections ---------- */
section {
    padding: 80px 0;
}

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

.title-underline {
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 2rem;
    border-radius: 2px;
}

/* ---------- About ---------- */
#about {
    background-color: #fff;
}

#about img {
    transition: var(--transition);
}

#about img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ---------- Services Grid ---------- */
#servicesGrid {
    position: relative;
}

/* Expandable service cards */
.service-card-expandable {
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.service-card-expandable:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ---------- Service Modal ---------- */
.service-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-modal.active {
    display: flex;
    opacity: 1;
}

.service-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.service-modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    margin: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.service-modal.active .service-modal-container {
    transform: scale(1);
}

.service-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.service-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.service-modal-close i {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.service-modal-body {
    padding: 3rem;
    overflow-y: auto;
    max-height: 90vh;
}

/* Card parts */
.service-card-header {
    padding: 0;
}

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

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card-expandable:hover .service-card-image img {
    transform: scale(1.1);
}

.service-card-title {
    padding: 1.5rem 1.5rem 0.5rem;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.service-card-summary {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.service-card-action {
    padding: 1rem 1.5rem;
    text-align: center;
    background: rgba(0, 102, 204, 0.05);
    transition: var(--transition);
}

.service-card-action .btn {
    pointer-events: none;
}

.service-card-expandable:hover .service-card-action {
    background: rgba(0, 102, 204, 0.1);
}

/* Detail layout inside modal */
.service-detail-left {
    padding-right: 2rem;
}

.service-detail-right {
    padding-left: 1rem;
}

.service-sub-items {
    margin-top: 1.5rem;
}

.service-sub-item-vertical {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.service-sub-item-vertical:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-sub-item-vertical h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.service-sub-item-vertical p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.7;
}

/* Legacy service cards (kept for compatibility) */
.service-card {
    border: none;
    border-radius: 15px;
    transition: var(--transition);
    overflow: hidden;
}

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

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.service-sub-item {
    padding: 1rem;
    background: rgba(0, 102, 204, 0.05);
    border-radius: 10px;
    height: 100%;
    transition: var(--transition);
}

.service-sub-item:hover {
    background: rgba(0, 102, 204, 0.1);
    transform: translateY(-3px);
}

.service-sub-item h5 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* ---------- Advantage Cards ---------- */
.advantage-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.advantage-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.advantage-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.advantage-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.advantage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.advantage-icon {
    display: inline-block;
    padding: 1rem;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.advantage-card:hover .advantage-icon {
    background: var(--primary-color);
    color: #fff !important;
}

/* ---------- Experience Section ---------- */
.experience-item {
    transition: var(--transition);
}

.experience-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.experience-number {
    color: var(--primary-color);
}

/* ---------- Success Cases ---------- */
#cases .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
}

#cases .card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2) !important;
}

#cases .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

#cases .card:hover .card-img-top {
    transform: scale(1.1);
}

/* ---------- Contact Section ---------- */
#contact {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}

#contact a {
    transition: var(--transition);
}

#contact a:hover {
    color: var(--accent-color) !important;
    text-decoration: underline !important;
}

.contact-info i {
    font-size: 1.2rem;
}

.qr-placeholder {
    max-width: 200px;
    margin: 0 auto;
}

/* ---------- Footer ---------- */
footer {
    background-color: var(--primary-color) !important;
}

/* ---------- Back-to-Top Button ---------- */
#backToTop {
    transition: var(--transition);
    opacity: 0.8;
}

#backToTop:hover {
    opacity: 1;
    transform: translateY(-5px);
}

/* ---------- Divider Section (Parallax) ---------- */
.divider-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 350px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.divider-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
}

.divider-section h2 {
    font-size: 3rem;
}

/* ---------- Social Icons ---------- */
.contact-social .social-icons {
    font-size: 1.5rem;
}

.social-icon-link {
    color: #fff;
    transition: var(--transition);
    font-size: 1.5rem;
}

.social-icon-link:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* ---------- Scroll Animations ---------- */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.animated {
    opacity: 1;
}

/* Direction-specific fades */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Legacy fade keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out;
}

/* ---------- Parallax Utility ---------- */
.parallax {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ---------- Utility Classes ---------- */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.shadow-custom {
    box-shadow: var(--shadow);
}

/* ---------- Loading Helper ---------- */
.loading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loading.loaded {
    opacity: 1;
}

/* ---------- Responsive Breakpoints ---------- */

/* Large tablets & small desktops */
@media (max-width: 992px) {
    .hero-section {
        height: 520px;
    }
    .divider-section {
        height: 300px;
    }
    .divider-section h2 {
        font-size: 2.5rem;
    }
}

/* Tablets & large phones */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    .display-3 {
        font-size: 2rem;
    }
    .display-4 {
        font-size: 2.5rem;
    }
    section {
        padding: 60px 0;
    }
    .hero-section {
        background-attachment: scroll;
        min-height: 550px;
        padding-top: 100px;
    }
    .service-detail-left {
        padding-right: 0;
        margin-bottom: 2rem;
    }
    .service-detail-right {
        padding-left: 0;
    }
    .service-card-image {
        height: 180px;
    }
    .service-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    .service-modal-body {
        padding: 2rem 1.5rem;
    }
    .divider-section {
        height: 250px;
        background-attachment: scroll;
    }
    .divider-section h2 {
        font-size: 2rem;
    }
    .divider-section .lead {
        font-size: 1rem;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .hero-section {
        height: 400px;
    }
    .section-title {
        font-size: 1.75rem;
    }
    .title-underline {
        width: 60px;
    }
    .service-card .card-body {
        padding: 1.5rem !important;
    }
    .advantage-image {
        height: 150px;
    }
    .advantage-content {
        padding: 1.5rem !important;
    }
}

/* ---------- Modal Full-Image ---------- */
.service-modal-image-full {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.service-modal-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    .service-modal-image-full {
        max-height: 400px;
    }
}