/* ============================================
   OUTSOURCING PAGE STYLES
   ============================================ */

/* ============================================
   HERO SECTION
   ============================================ */
.outsourcing-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    padding: 5rem 2rem;
    position: relative;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)),
                url('../images/games/nazralath/image.psd.png') center/cover;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

.outsourcing-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15%;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0) 0%,
        var(--darker-bg) 100%
    );
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 33.33vh;
    margin-top: 4rem;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    text-align: center;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-light);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    text-align: justify;
}

/* ============================================
   TEAM SECTION
   ============================================ */
.team-section {
    padding: 5rem 0;
    background: var(--darker-bg);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.team-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 0, 0, 0.4);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    grid-column: span 2;
}

/* Center the last 2 items in the row */
.team-card:nth-child(7) {
    grid-column: 2 / 4;
}

.team-card:nth-child(8) {
    grid-column: 4 / 6;
}

.team-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-red);
    box-shadow: 0 10px 30px rgba(102, 0, 0, 0.3);
}

.team-image-wrapper {
    margin-bottom: 1.5rem;
}

.team-image-placeholder {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    background: rgba(102, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-red);
    user-select: none;
    pointer-events: none;
}

.team-image-placeholder img {
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

.team-image-placeholder i {
    font-size: 4rem;
    color: var(--primary-red);
}

.team-name {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.team-position {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.team-role {
    color: var(--primary-red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.team-card p:not(.team-role):not(.team-position) {
    color: #ccc;
    line-height: 1.6;
    text-align: justify;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio-section {
    padding: 5rem 0;
    background: var(--dark-bg);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    grid-column: span 2;
}

/* Center single item in last row (positions 1, 4, 7...) */
.portfolio-card:last-child:nth-child(3n+1) {
    grid-column: 3 / 5;
}

/* Center two items in last row (positions 3n+1 and 3n+2) */
.portfolio-card:nth-last-child(2):nth-child(3n+1) {
    grid-column: 2 / 4;
}

.portfolio-card:last-child:nth-child(3n+2) {
    grid-column: 4 / 6;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-red);
    box-shadow: 0 10px 30px rgba(102, 0, 0, 0.3);
}

.portfolio-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}

.portfolio-placeholder i {
    font-size: 4rem;
    color: var(--primary-red);
    opacity: 0.5;
}

/* Video Overlay Styles */
.portfolio-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2;
}

.portfolio-video {
    width: 100%;
    height: 100%;
    border: none;
}

/* Image Carousel Styles */
.portfolio-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2;
    display: none;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.portfolio-content {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.portfolio-content h3 {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.portfolio-content p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: justify;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    justify-content: center;
}

.tag {
    background: var(--primary-red);
    color: var(--text-light);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-section {
    padding: 5rem 0;
    background: var(--darker-bg);
}

.about-content {
    max-width: 33.33%;
    margin: 0 auto;
}

.about-text {
    margin: 2rem 0 3rem;
}

.about-text p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.services-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 0, 0, 0.4);
    border-radius: 10px;
    padding: 2rem;
}

.services-list h3 {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: center;
}

.services-list ul {
    list-style: none;
    padding: 0;
}

.services-list li {
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.services-list li:last-child {
    border-bottom: none;
}

.services-list li i {
    color: var(--primary-red);
    font-size: 1rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    padding: 5rem 0;
    background: var(--dark-bg);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-content > p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.contact-info {
    margin: 3rem 0;
}

.contact-method {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--primary-red);
    border-radius: 10px;
    padding: 1.5rem 2.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-light);
}

.contact-method:hover {
    background: rgba(102, 0, 0, 0.2);
    transform: scale(1.05);
}

.contact-method i {
    font-size: 2rem;
    color: var(--primary-red);
}

.contact-method span {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-method:hover span,
.contact-method:active span {
    color: var(--text-light);
}

.contact-note {
    color: #999;
    font-size: 0.95rem;
    font-style: italic;
}

.button-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid var(--primary-red);
    color: var(--dark-bg);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-link:hover {
    background: var(--dark-bg);
    color: white;
}

.button-link i {
    font-size: 1.2em;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Foldable/Tablet Landscape (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) and (orientation: landscape) {
    .outsourcing-hero {
        padding-top: 8rem;
    }

    .hero-content h1 {
        font-size: clamp(1.5rem, 2.5vw, 1.8rem);
        padding-bottom: 2rem;
    }
}

/* Desktop (1025px - 1399px, excluding tablet portrait) */
@media (min-width: 1025px) and (max-width: 1399px) and (min-height: 700px) {
    .hero-content h1 {
        font-size: clamp(1.8rem, 3vw, 2.2rem);
    }
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-content h1 {
        max-width: 33.33vw;
        white-space: normal;
    }

    .hero-content p {
        max-width: 33.33vw;
        height: 33.33vh;
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
    }

    .team-grid {
        gap: 3rem;
    }

    .team-card {
        padding: 2.5rem;
    }
}

/* Medium Desktop (1025px - 1399px) */
@media (min-width: 1025px) and (max-width: 1399px) {
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-content h1 {
        max-width: 33.33vw;
        white-space: normal;
    }

    .hero-content p {
        max-width: 33.33vw;
        height: 33.33vh;
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
    }

    .team-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }

    .team-card {
        padding: 1.5rem;
    }

    .team-name {
        font-size: 1.2rem;
    }

    .team-position {
        font-size: 0.95rem;
    }

    .about-content {
        max-width: 40%;
    }
}

/* Tablet Portrait (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .outsourcing-hero {
        padding: 5rem 4rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .team-card {
        grid-column: auto;
    }

    .team-card:nth-child(7),
    .team-card:nth-child(8) {
        grid-column: auto;
    }

    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .portfolio-card {
        grid-column: span 2 !important;
    }

    /* Override desktop 3-column centering */
    .portfolio-card:last-child:nth-child(3n+1),
    .portfolio-card:nth-last-child(2):nth-child(3n+1),
    .portfolio-card:last-child:nth-child(3n+2) {
        grid-column: span 2 !important;
    }

    /* Center last portfolio item if odd number */
    .portfolio-card:last-child:nth-child(odd) {
        grid-column: 2 / 4 !important;
    }

    .about-content {
        max-width: 60%;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }
}

/* Mobile Portrait (≤768px) */
@media (max-width: 768px) {
    .outsourcing-hero {
        padding: 5rem 1.5rem;
        background-attachment: scroll;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        white-space: normal;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .team-section,
    .portfolio-section,
    .about-section,
    .contact-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .team-card {
        padding: 1.5rem;
        grid-column: auto;
    }

    .team-card:nth-child(7),
    .team-card:nth-child(8) {
        grid-column: auto;
    }

    .team-image-placeholder {
        width: 120px;
        height: 120px;
    }

    .team-image-placeholder i {
        font-size: 3rem;
    }

    .team-name {
        font-size: 1.3rem;
    }

    .team-position {
        font-size: 0.95rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .portfolio-card {
        grid-column: auto !important;
    }

    .portfolio-card:last-child:nth-child(3n+1),
    .portfolio-card:nth-last-child(2):nth-child(3n+1),
    .portfolio-card:last-child:nth-child(3n+2) {
        grid-column: auto !important;
    }

    .about-content {
        max-width: 100%;
    }

    .about-text p {
        font-size: 1rem;
    }

    .services-list {
        padding: 1.5rem;
    }

    .services-list h3 {
        font-size: 1.6rem;
    }

    .services-list li {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }

    .contact-content > p {
        font-size: 1.1rem;
    }

    .contact-method {
        flex-direction: column;
        padding: 1.5rem 1.5rem;
        width: 100%;
        max-width: 300px;
    }

    .contact-method i {
        font-size: 1.8rem;
    }

    .contact-method a {
        font-size: 1.1rem;
        word-break: break-word;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .outsourcing-hero {
        padding: 5rem 1rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .team-section,
    .portfolio-section,
    .about-section,
    .contact-section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .team-card {
        padding: 1.25rem;
    }

    .team-name {
        font-size: 1.15rem;
    }

    .team-position {
        font-size: 0.9rem;
    }

    .portfolio-content h3 {
        font-size: 1.2rem;
    }

    .services-list h3 {
        font-size: 1.4rem;
    }

    .services-list li {
        font-size: 0.9rem;
    }

    .contact-method {
        padding: 1.25rem 1rem;
    }

    .contact-method a {
        font-size: 1rem;
    }
}

/* Mobile Landscape (≤768px width, landscape) */
@media (max-width: 768px) and (orientation: landscape) {
    .outsourcing-hero {
        padding: 5rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .team-card {
        grid-column: auto;
    }

    .team-card:nth-child(7),
    .team-card:nth-child(8) {
        grid-column: auto;
    }

    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .portfolio-card {
        grid-column: span 2 !important;
    }

    /* Override desktop 3-column centering */
    .portfolio-card:last-child:nth-child(3n+1),
    .portfolio-card:nth-last-child(2):nth-child(3n+1),
    .portfolio-card:last-child:nth-child(3n+2) {
        grid-column: span 2 !important;
    }

    /* Center last portfolio item if odd number */
    .portfolio-card:last-child:nth-child(odd) {
        grid-column: 2 / 4 !important;
    }

    .about-content {
        max-width: 80%;
    }

    .about-text p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .services-list h3 {
        font-size: 1.4rem;
    }

    .services-list li {
        font-size: 0.9rem;
    }

    .team-section,
    .portfolio-section,
    .about-section,
    .contact-section {
        padding: 2.5rem 0;
    }
}

/* Tablet Landscape (769px - 1024px, landscape) */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .outsourcing-hero {
        padding: 5rem 4rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .team-card {
        padding: 1.5rem;
        grid-column: auto;
    }

    .team-card:nth-child(7),
    .team-card:nth-child(8) {
        grid-column: auto;
    }

    .portfolio-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.8rem;
    }

    .portfolio-card {
        padding: 1.5rem;
        grid-column: span 2;
    }

    /* Center single item in last row */
    .portfolio-card:last-child:nth-child(3n+1) {
        grid-column: 3 / 5;
    }

    /* Center two items in last row */
    .portfolio-card:nth-last-child(2):nth-child(3n+1) {
        grid-column: 2 / 4;
    }

    .portfolio-card:last-child:nth-child(3n+2) {
        grid-column: 4 / 6;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .services-list li {
        font-size: 0.95rem;
    }

    .team-image-placeholder {
        width: 120px;
        height: 120px;
    }

    .team-image-placeholder i {
        font-size: 3rem;
    }

    .team-name {
        font-size: 1.2rem;
    }

    .team-position {
        font-size: 0.95rem;
    }
}

/* Very Small Mobile (≤380px) */
@media (max-width: 380px) {
    .hero-content h1 {
        font-size: 1.4rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .hero-content {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .team-name {
        font-size: 1.1rem;
    }

    .team-position {
        font-size: 0.85rem;
    }

    .team-image-placeholder {
        width: 100px;
        height: 100px;
    }

    .team-image-placeholder i {
        font-size: 2.5rem;
    }
}
