/* 
  EMSAR GROUP Portal Styles
  Refined for Full-Screen 3-Column Layout
*/

.group-portal-section {
    padding: 0;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.group-grid {
    display: flex;
    /* Changed from grid to flex for full screen columns */
    width: 100%;
    height: 100%;
}

.group-card {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    color: white;
}

.text-left {
    text-align: left;
}

/* Background Images for columns */
.group-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -2;
}

#solutions-card::before {
    background-image: url('../images/hero_v2.png');
}

#studio-card::before {
    background-image: url('../images/emsar_3d_studio_hero_1770059150069.png');
}

#consulting-card::before {
    background-image: url('../images/consulting_home.png');
}

/* Overlay for readability */
.group-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.4), rgba(10, 10, 10, 0.9));
    transition: background 0.5s ease;
    z-index: -1;
}

.group-card:hover {
    flex: 1.5;
    /* Expand column on hover */
}

.group-card:hover::before {
    transform: scale(1.1);
}

.group-card:hover::after {
    background: rgba(37, 99, 235, 0.3);
    /* Tint blue on hover */
}

.group-card-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.5s ease;
}

.group-card:hover .group-card-icon {
    transform: scale(1.1) rotate(360deg);
    background: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 0 30px var(--secondary);
}

.group-card h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s ease;
}

.group-card p {
    font-size: 1.2rem;
    max-width: 300px;
    opacity: 0.8;
    transition: opacity 0.5s ease;
}

.group-card:hover h3 {
    transform: translateY(-10px);
}

/* Full Width Nav Refinement */
.full-width-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    /* Added padding as requested */
    width: 100%;
}

@media (max-width: 768px) {
    .full-width-nav {
        padding: 15px 25px;
    }
}

/* Page Transitions */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 9999;
    transform: translateY(100%);
    pointer-events: none;
}

.page-transition.active {
    animation: transitionIn 0.8s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

@keyframes transitionIn {
    0% {
        transform: translateY(100%);
    }

    50% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100%);
    }
}

.content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Detail Sections Handling */
.detail-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--primary);
    /* Fixed: Ensuring solid background */
    z-index: 100;
    /* Base layer for detail view */
    overflow-y: auto;
    padding-top: 0;
    /* Removed padding to allow sticky header flow */
    padding-bottom: 80px;
}

.detail-view.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.main-view.hidden {
    display: none;
}

.text-color-secondary {
    color: var(--secondary)
}

/* Detail Header */
.detail-header {
    position: sticky;
    top: 128px;
    /* Initial: Flush with 128px Navbar */
    margin-top: 150px;
    /* User requested start position */
    left: 0;
    width: 100%;
    padding: 30px 60px;
    z-index: 300;
    /* Highest priority */
    pointer-events: auto;
    /* Enable interactions */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    transition: top 0.4s ease, background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}

.detail-header.scrolled {
    top: 112px;
    /* Scrolled: Flush with 112px Navbar */
    background: rgba(255, 255, 255, 1);
    /* Solid white */
    backdrop-filter: blur(15px);
    padding: 12px 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.detail-header.scrolled .detail-title {
    color: #000000 !important;
    text-shadow: none !important;
}

.detail-header.scrolled .back-btn {
    border-color: rgba(0, 0, 0, 0.1);
    color: #000000 !important;
    background: rgba(0, 0, 0, 0.05);
}

.detail-header.scrolled .back-btn:hover {
    background: var(--secondary);
    color: white !important;
}

.detail-header .back-btn {
    pointer-events: auto;
    position: static;
    /* Let flex handle it */
    transform: none;
}

.detail-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeIn 0.5s 0.3s ease forwards;
    transition: color 0.3s ease;
}

/* Premium Back Button */
.back-btn {
    /* Base styles mainly handled by detail-header placement now */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.back-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-btn:hover .back-icon {
    transform: translateX(-3px);
}

/* Synced Content Styles */
.py-80 {
    padding-top: 80px;
    padding-bottom: 80px;
}

.mb-100 {
    margin-bottom: 100px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.visual-box {
    display: flex;
    justify-content: center;
}

/* Toggleable List Logic */
/* Toggleable List Logic */
.feature-list>li.expandable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.feature-list>li {
    padding-top: 5px;
    padding-bottom: 5px;
}

.feature-list>li>strong {
    display: flex;
    width: 100%;
    align-items: center;
    position: relative;
    /* justify-content: space-between; -- Removed to let non-expandable items flow normally */
}

.feature-list>li.expandable>strong {
    justify-content: space-between;
}

/* Plus Icon for Toggles - Only for Expandable */
.feature-list>li.expandable>strong::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    margin-left: 15px;
    transition: transform 0.3s ease;
}

/* Rotate to X when active */
.feature-list>li.active>strong::after {
    transform: rotate(45deg);
}

/* Sub-list Styles - Hidden by Default */
.feature-list ul {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-in, margin-top 0.3s ease;
    margin-top: 0;
}

/* Open State */
.feature-list>li.active ul {
    max-height: 500px;
    /* Arbitrary large height */
    opacity: 1;
    margin-top: 15px;
}

/* Arrow Rotation */
.feature-list>li::before {
    transition: transform 0.3s ease;
}

.feature-list>li.active::before {
    transform: rotate(90deg);
}

.feature-list>li.active>strong {
    color: var(--secondary);
}


.tech-grid,
.feature-list-horizontal {
    /* Legacy/unused - keeping for safety or removal */
    display: none;
}

.tech-item,
.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.tech-item:hover,
.feature-card:hover {
    border-color: var(--secondary);
    transform: translateY(-5px);
}

.tech-item h4,
.feature-card h4 {
    color: var(--secondary);
    margin-bottom: 10px;
}

/* 3D Studio Specific */
.studio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.studio-item {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure it fills grid cell height */
}

.studio-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
    flex-shrink: 0;
}

.studio-item:hover img {
    transform: scale(1.1);
}

.studio-info {
    padding: 20px;
    background: var(--card-bg);
    flex-grow: 1;
    /* Pushes content to fill height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Or space-between if you want title at top, desc at bottom */
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    transition: gap 0.3s ease;
}

.btn-back:hover {
    gap: 15px;
}

@media (max-width: 968px) {
    .group-portal-section {
        height: auto;
        min-height: 100vh;
    }

    .group-grid {
        flex-direction: column;
    }

    .group-card {
        width: 100%;
        min-height: 400px;
        flex: none;
        /* Disable 1.5 hover effect which breaks logic on mobile */
        padding: 60px 20px;
    }

    .group-card:hover {
        flex: none;
    }

    .detail-header {
        padding: 20px;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 15px;
        background: var(--primary);
        /* Solid bg for header on mobile */
        height: auto;
        position: fixed;
    }

    .detail-view {
        padding-top: 240px;
    }

    .detail-title {
        font-size: 1.5rem;
    }
}

/* Coming Soon Styles */
.coming-soon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-top: 40px;
}

.coming-soon-content {
    text-align: center;
    padding: 60px 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.coming-soon-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 60%);
    animation: rotateFlow 10s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rotateFlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.grand-coming-soon {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 20%, #2563EB 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
    filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.4));
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.3));
    }

    to {
        filter: drop-shadow(0 0 40px rgba(37, 99, 235, 0.6));
    }
}

.coming-soon-sub {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .grand-coming-soon {
        font-size: 3rem;
    }

    .coming-soon-content {
        padding: 40px 20px;
        width: 100%;
    }

    .coming-soon-sub {
        font-size: 1rem;
    }
}