/**
 * Page-specific styles: gallery, contact form, hero, buttons.
 * Linked from index.php.
 */

/* WOW.js: hide elements until they animate into view (WOW sets visibility via inline style when showing) */
.wow {
    visibility: hidden;
}

/* Enhanced Gallery Styles */
.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px; }
    @media (max-width: 480px) {
      .gallery-item {
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
      } }

.gallery-item:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(39,104,255,0.2);
}

.gallery-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 240px;
    flex-shrink: 0; }
    @media (max-width: 480px) {
      .gallery-img-wrapper {
        height: 200px;
      } }
    @media (max-width: 380px) {
      .gallery-img-wrapper {
        height: 180px;
      } }

.gallery-img {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
    overflow: hidden;
    display: block;
}

.gallery-img img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 250px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
    filter: brightness(0.95) contrast(1.05) saturate(1.1);
    background: linear-gradient(135deg, rgba(39,104,255,0.1) 0%, rgba(190,39,255,0.1) 100%);
}

.gallery-item:hover .gallery-img img {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* Image overlay for theme consistency */
.gallery-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(39,104,255,0.05) 0%, rgba(190,39,255,0.05) 50%, rgba(39,104,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover .gallery-img::before {
    opacity: 1;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(39,104,255,0.9) 0%, rgba(190,39,255,0.9) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-overlay-content i {
    animation: pulse 2s infinite;
}

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

.gallery-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    background: linear-gradient(135deg, #2768FF 0%, #1a4fcc 100%);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(39,104,255,0.3);
    transform: scale(0);
    transition: transform 0.3s ease; }
    @media (max-width: 480px) {
      .gallery-badge {
        padding: 5px 12px;
        font-size: 11px;
        top: 12px;
        right: 12px;
      } }
    @media (max-width: 380px) {
      .gallery-badge {
        padding: 4px 10px;
        font-size: 10px;
        top: 10px;
        right: 10px;
      } }

.gallery-item:hover .gallery-badge {
    transform: scale(1);
}

.gallery-content {
    padding: 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column; }
    @media (max-width: 480px) {
      .gallery-content {
        padding: 16px;
      } }
    @media (max-width: 380px) {
      .gallery-content {
        padding: 14px;
      } }

.gallery-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(39,104,255,0.1) 0%, rgba(190,39,255,0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: all 0.3s ease; }
    @media (max-width: 480px) {
      .gallery-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 12px;
      } }
    @media (max-width: 380px) {
      .gallery-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
      } }

.gallery-icon i {
    font-size: 24px;
    color: #2768FF;
    transition: all 0.3s ease; }
    @media (max-width: 480px) {
      .gallery-icon i {
        font-size: 20px;
      } }
    @media (max-width: 380px) {
      .gallery-icon i {
        font-size: 18px;
      } }

.gallery-item:hover .gallery-icon {
    background: linear-gradient(135deg, #2768FF 0%, #BE27FF 100%);
    transform: rotate(5deg) scale(1.1);
}

.gallery-item:hover .gallery-icon i {
    color: white;
    transform: rotate(-5deg);
}

.gallery-content h5 {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.gallery-item:hover .gallery-content h5 {
    color: #2768FF;
}

.gallery-content p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
    flex-grow: 1;
}

.gallery-link {
    color: #2768FF;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.gallery-link i {
    transition: transform 0.3s ease;
}

.gallery-link:hover {
    color: #1a4fcc;
    text-decoration: none;
}

.gallery-link:hover i {
    transform: translateX(5px);
}

/* Image placeholder styling for missing/broken images */
.gallery-img {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    position: relative;
}

.gallery-img img {
    border: 1px solid rgba(0,0,0,0.05);
}

/* Force image to fill container when broken or loading - prevents clipping */
.gallery-item .gallery-img {
    position: relative;
}
.gallery-item .gallery-img img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
}

/* Image loading state */
.gallery-img img[loading="lazy"] {
    background: linear-gradient(135deg, #e3f2fd 0%, #c8e6c9 100%);
}

/* Mobile gallery section improvements */
@media (max-width: 640px) {
    .gallery-section .section-title h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }
    
    .gallery-section .section-title p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    .gallery-section h3 {
        font-size: 19px !important;
        margin: 20px 0 12px !important;
        word-break: break-word;
    }
}

@media (max-width: 380px) {
    .gallery-img-wrapper {
        height: 180px;
    }
    .gallery-img {
        min-height: 180px;
    }
    .gallery-img img {
        min-height: 0;
    }
    .gallery-content {
        padding: 15px;
    }
    .gallery-content h5 {
        font-size: 16px;
    }
}
@media (max-width: 480px) {
    .gallery-img-wrapper {
        height: 200px;
    }
    .gallery-img {
        min-height: 200px;
    }
    .gallery-img img {
        min-height: 0;
    }
    .gallery-content {
        padding: 18px;
    }
    .gallery-content h5 {
        font-size: 17px;
    }
}
@media (max-width: 768px) {
    .gallery-img-wrapper {
        height: 220px;
    }
    .gallery-img {
        min-height: 220px;
    }
    .gallery-img img {
        min-height: 0;
    }
    .gallery-content {
        padding: 20px;
    }
    .gallery-content h5 {
        font-size: 18px;
    }
}

/* Form & Lead Submission Styles */
.contact-form { position: relative; }
.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.contact-form .alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5; }
    @media only screen and (min-width: 480px) {
      .contact-form .alert {
        padding: 16px 20px;
        margin-bottom: 22px;
        font-size: 14px;
        line-height: 1.6; } }
    @media only screen and (min-width: 768px) {
      .contact-form .alert {
        padding: 18px 24px;
        margin-bottom: 25px;
        font-size: 15px;
      } }
.contact-form .alert i {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}
.contact-form .alert-success {
    background: linear-gradient(135deg, rgba(40,167,69,0.15) 0%, rgba(40,167,69,0.08) 100%);
    border: 1px solid rgba(40,167,69,0.3);
    color: #155724;
}
.contact-form .alert-success i { color: #BE27FF; }
.contact-form .alert-danger {
    background: linear-gradient(135deg, rgba(220,53,69,0.12) 0%, rgba(220,53,69,0.06) 100%);
    border: 1px solid rgba(220,53,69,0.25);
    color: #721c24;
}
.contact-form .alert-danger i { color: #dc3545; }
.form-select-custom {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #F4EEFB;
    border-radius: 30px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    cursor: pointer; }
    @media only screen and (min-width: 480px) {
      .form-select-custom {
        padding: 13px 22px;
        font-size: 15px;
      } }
    @media only screen and (min-width: 768px) {
      .form-select-custom {
        padding: 18px 25px;
        font-size: 16px;
      } }
.form-select-custom:focus {
    outline: none;
    border-color: #2768FF;
    box-shadow: 0 0 0 3px rgba(39,104,255,0.1);
}

/* Responsive Enhancements */
@media (max-width: 380px) {
    .carousel-content h1 { font-size: 1.6rem !important; }
    .carousel-content h2 { font-size: 1.4rem !important; }
    .carousel-content h3 { font-size: 1rem !important; }
    .carousel-content p { font-size: 0.85rem !important; line-height: 1.5 !important; }
    .section-title span { font-size: 13px !important; }
    .section-title h2 { font-size: 20px !important; line-height: 1.3 !important; }
}
@media (min-width: 381px) and (max-width: 480px) {
    .carousel-content h1 { font-size: 1.8rem !important; }
    .carousel-content h2 { font-size: 1.6rem !important; }
    .carousel-content h3 { font-size: 1.1rem !important; }
    .carousel-content p { font-size: 0.9rem !important; line-height: 1.6 !important; }
    .section-title span { font-size: 14px !important; }
    .section-title h2 { font-size: 22px !important; line-height: 1.3 !important; }
}
@media (min-width: 481px) and (max-width: 640px) {
    .carousel-content h1 { font-size: 2rem !important; }
    .carousel-content h2 { font-size: 1.75rem !important; }
    .carousel-content h3 { font-size: 1.25rem !important; }
    .carousel-content p { font-size: 0.95rem !important; }
    .section-title span { font-size: 16px !important; }
    .section-title h2 { font-size: 24px !important; line-height: 1.4 !important; }
}
@media (min-width: 641px) and (max-width: 768px) {
    .carousel-content h1 { font-size: 2.2rem !important; }
    .carousel-content h2 { font-size: 1.9rem !important; }
    .carousel-content h3 { font-size: 1.35rem !important; }
    .carousel-content p { font-size: 1rem !important; }
    .section-title span { font-size: 18px !important; }
    .section-title h2 { font-size: 28px !important; line-height: 1.4 !important; }
}
@media (min-width: 769px) and (max-width: 991px) {
    .carousel-content h1 { font-size: 2.5rem !important; }
    .carousel-content h2 { font-size: 2.2rem !important; }
    .carousel-content h3 { font-size: 1.5rem !important; }
    .carousel-content p { font-size: 1.05rem !important; }
}
@media only screen and (min-width: 991px) {
    .carousel-content h1 { font-size: 3.5rem !important; }
    .carousel-content h2 { font-size: 3rem !important; }
    .carousel-content h3 { font-size: 2rem !important; }
    .carousel-content p { font-size: 1.1rem !important; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
.contact-form input,
.contact-form textarea,
.contact-form .form-select-custom {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-form input:focus,
.contact-form textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(39,104,255,0.08);
}

/* Contact section: fix Headquarters & Global Reach icon backgrounds */
.contact-section .contact-item-wrapper .contact-item .contact-icon {
    flex-shrink: 0;
    min-width: 50px;
    min-height: 50px;
    background: #5a4fcf;
    background: linear-gradient(135deg, #2768FF 0%, #BE27FF 100%);
    -webkit-box-shadow: 0 2px 12px rgba(55, 99, 235, 0.35);
    box-shadow: 0 2px 12px rgba(55, 99, 235, 0.35);
    border: none;
}
.contact-section .contact-item-wrapper .contact-item .contact-icon i {
    color: #fff !important;
}

/* Hero Wire-Wiring-Harness Section - Attractive styling */
.hero-wire-harness {
    position: relative;
    background-position: center center !important;
    background-size: cover !important;
}
.hero-wire-harness::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(to bottom, transparent 0%, transparent 85%, rgba(255,255,255,0.08) 100%),
        linear-gradient(135deg, rgba(39,104,255,0.78) 0%, rgba(111,88,232,0.72) 50%, rgba(190,39,255,0.68) 100%);
    z-index: 1;
    pointer-events: none;
}
.hero-wire-harness.clip-bg::after {
    background: linear-gradient(120deg, rgba(39,104,255,0.55) 0%, rgba(111,88,232,0.5) 50%, rgba(190,39,255,0.5) 100%);
}
.hero-wire-harness .carousel-content {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.hero-wire-harness .section-title span {
    background: rgba(255,255,255,0.15);
    padding: 8px 20px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
}
.hero-wire-harness .theme-btn.border-btn {
    border-width: 2px;
    backdrop-filter: blur(4px);
}
.hero-wire-harness .theme-btn:not(.border-btn) {
    box-shadow: 0 4px 20px rgba(39,104,255,0.4);
}

.theme-btn {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39,104,255,0.35);
}
.theme-btn:active {
    transform: translateY(0);
}
.feature-box, .service-box {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .feature-box .feature-icon,
    .service-box .service-icon {
        width: 55px !important;
        height: 55px !important;
        font-size: 22px !important;
        margin-bottom: 20px !important;
    }
    
    .feature-box .box-content-style h4,
    .service-box .box-content-style h4 {
        font-size: 17px !important;
        margin-bottom: 12px !important;
    }
}
.feature-box:hover, .service-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.navbar-brand, .footer-links a, .header-btn .theme-btn {
    transition: all 0.3s ease;
}

/* Make service cards in the portfolio section equal height */
.portfolio-section .row > [class*="col-"] {
    display: flex;
}
.portfolio-section .service-box {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.portfolio-section .service-box .box-content-style {
    flex: 1 1 auto;
}

/* Gallery image clickable - ensure clicks work */
.gallery-img {
    cursor: zoom-in;
    position: relative;
}

.gallery-img img {
    cursor: zoom-in;
    pointer-events: auto;
    display: block;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s ease;
}

.gallery-img img:hover {
    opacity: 0.9;
}

/* Gallery overlay - must not block clicks */
.gallery-overlay {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Simple lightbox styles */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 25px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.1);
}

.lightbox-close i {
    color: #2768FF;
    font-size: 24px;
}

.lightbox-info {
    margin-top: 15px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-modal {
        padding: 15px;
    }
    
    .lightbox-img {
        max-height: 80vh;
    }
    
    .lightbox-close {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .lightbox-close i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .lightbox-modal {
        padding: 10px;
    }
    
    .lightbox-img {
        max-height: 75vh;
        border-radius: 5px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .lightbox-close i {
        font-size: 18px;
    }
}
