/**
 * PPI Landing Pages Styles
 * Enhanced design with modern UI/UX
 * Palier 1: Dynamic banner with responsive images
 *
 * @package PPI_Landing_Pages
 */

/* ==========================================================================
   LANDING PAGE LAYOUT - HIDE NAVIGATION
   ========================================================================== */

/* Hide main navigation to eliminate marketing exit points */
.main-nav {
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide desktop header search to eliminate marketing exit points */
.advanced-search {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ==========================================================================
   BANNER SECTION
   ========================================================================== */

/* Dynamic Banner Container - Full Width */
.ppi-landing-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 60px;
    background: linear-gradient(135deg, #0077BE 0%, #005A8F 100%);
    overflow: hidden;
    min-height: 400px;
}

/* Banner Image - Positioned as background */
.ppi-banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    line-height: 0;
    z-index: 0;
}

.ppi-banner-image img,
.ppi-banner-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center bottom;
}

/* Dark overlay for better text readability */
.ppi-landing-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Banner Content Container - Centered over image */
.ppi-landing-banner .container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 60px 20px;
}

/* Banner Content (text overlay) */
.ppi-banner-content {
    text-align: center;
    color: #ffffff;
    animation: fadeInUp 0.8s ease-out;
    max-width: 800px;
    width: 100%;
}

/* Fallback when no image: keep gradient background */
.ppi-landing-banner:not(:has(.ppi-banner-image)) .container {
    min-height: 300px;
}

.ppi-landing-banner:not(:has(.ppi-banner-image))::before {
    display: none;
}

/* Banner Headline */
.ppi-banner-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Banner Subline */
.ppi-banner-content p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #ffffff;
    opacity: 0.98;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
    line-height: 1.4;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Button */
.ppi-banner-cta {
    display: inline-block;
    padding: 16px 40px;
    background: #FF6B35;
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.ppi-banner-cta:hover {
    background: #FF8555;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.ppi-banner-cta:active {
    transform: translateY(-1px);
}

/* Smooth scroll behavior for CTA */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   LEAD FORM SECTION
   ========================================================================== */

.ppi-lead-form-wrap {
    background: #f5f5f5;
    padding: 60px 0;
    margin-bottom: 60px;
    border-radius: 0;
}

.ppi-lead-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 40px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Form Title - Contact Page Style */
.ppi-lead-form-container h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 600;
    color: #0077BE;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 3px solid #ff9800;
    display: inline-block;
    width: 100%;
}

/* Remove the gradient underline, use solid orange border instead */
.ppi-lead-form-container h3::after {
    display: none;
}

/* Form Groups */
.ppi-lead-form .form-row {
    margin-bottom: 10px;
}

.ppi-lead-form .form-group {
    margin-bottom: 20px;
}

/* Form Inputs - Contact Page Style */
.ppi-lead-form .form-control {
    height: 50px;
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
    width: 100%;
    font-family: inherit;
}

.ppi-lead-form .form-control:hover {
    border-color: #0077BE;
}

.ppi-lead-form .form-control:focus {
    border-color: #0077BE;
    box-shadow: 0 0 0 2px rgba(0, 119, 190, 0.1);
    background: #ffffff;
    outline: none;
}

.ppi-lead-form .form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Input validation states */
.ppi-lead-form .form-control:valid {
    border-color: #28a745;
}

.ppi-lead-form .form-control:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

/* Submit Button - Contact Page Style (Orange) */
.ppi-lead-form .btn-primary {
    width: 100%;
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    background: #ff9800;
    border: none;
    margin-top: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: #ffffff;
}

.ppi-lead-form .btn-primary:hover {
    background: #e68900;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.ppi-lead-form .btn-primary:active {
    transform: scale(0.98);
}

.ppi-lead-form .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Form Messages */
.ppi-form-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    animation: slideInDown 0.4s ease-out;
}

.ppi-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    display: block;
}

.ppi-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    display: block;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.ppi-lead-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ppi-lead-form.loading .btn-primary {
    position: relative;
}

.ppi-lead-form.loading .btn-primary::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .ppi-landing-banner {
        min-height: 350px;
    }
    
    .ppi-banner-content h2 {
        font-size: 2.5rem;
    }
    
    .ppi-banner-content p {
        font-size: 1.25rem;
    }
    
    .ppi-lead-form-container {
        padding: 35px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .ppi-landing-banner {
        min-height: 300px;
        margin-bottom: 40px;
    }
    
    .ppi-landing-banner .container {
        min-height: 300px;
        padding: 40px 20px;
    }
    
    .ppi-banner-content h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .ppi-banner-content p {
        font-size: 1.125rem;
        margin-bottom: 25px;
    }
    
    .ppi-banner-cta {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    .ppi-landing-banner:not(:has(.ppi-banner-image)) .container {
        min-height: 250px;
    }

    .ppi-lead-form-wrap {
        padding: 40px 0;
        margin-bottom: 40px;
    }
    
    .ppi-lead-form-container {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .ppi-lead-form-container h3 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    .ppi-lead-form .form-group {
        margin-bottom: 15px;
    }
    
    .ppi-lead-form .form-control {
        height: 52px;
        font-size: 1rem;
    }
    
    .ppi-lead-form .btn-primary {
        height: 52px;
        font-size: 1rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .ppi-landing-banner {
        min-height: 280px;
    }
    
    .ppi-landing-banner .container {
        min-height: 280px;
        padding: 30px 15px;
    }
    
    .ppi-banner-content h2 {
        font-size: 1.625rem;
    }
    
    .ppi-banner-content p {
        font-size: 1rem;
    }
    
    .ppi-banner-cta {
        padding: 12px 28px;
        font-size: 0.95rem;
    }
    
    .ppi-lead-form-container {
        padding: 25px 15px;
    }
    
    .ppi-lead-form-container h3 {
        font-size: 1.375rem;
    }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .ppi-landing-banner {
        min-height: 250px;
    }
    
    .ppi-landing-banner .container {
        min-height: 250px;
        padding: 25px 15px;
    }
    
    .ppi-banner-content h2 {
        font-size: 1.5rem;
    }
    
    .ppi-banner-content p {
        font-size: 0.95rem;
    }
    
    .ppi-banner-cta {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* ========================================
   Floating Contact Button
   ======================================== */

.ppi-floating-contact-btn {
    position: fixed;
    bottom: 81px;
    right: 30px;
    width: 42px;
    height: 42px;
    background: #ff9800;
    border: none;
    border-radius: 10%;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #ffffff;
}

.ppi-floating-contact-btn:hover {
    background: #e68900;
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.6);
    transform: scale(1.1);
}

.ppi-floating-contact-btn:active {
    transform: scale(0.95);
}

.ppi-floating-contact-btn i {
    font-size: 24px;
    color: #ffffff;
}

/* Responsive adjustments for floating button */
@media (max-width: 768px) {
    .ppi-floating-contact-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .ppi-floating-contact-btn i {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .ppi-floating-contact-btn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .ppi-floating-contact-btn i {
        font-size: 20px;
    }
}

/* ============================================
   CUSTOM SEARCH BAR (Palier 1.5)
   ============================================ */

.ppi-landing-search {
    margin: 20px 0 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ppi-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.ppi-search-control {
    flex: 1 1 auto;
    min-width: 150px;
}

.ppi-search-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Segmented Control (Facade Switch) */
.ppi-segmented-control {
    display: flex;
    gap: 4px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 6px;
}

.ppi-segment {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ppi-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

label.ppi-segment {
    margin-bottom: 0;
    padding-bottom: 0;
}

.ppi-segment-label {
    display: block;
    padding: 3px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ppi-segment:hover .ppi-segment-label {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}

.ppi-segment.active .ppi-segment-label,
.ppi-segment input:checked + .ppi-segment-label {
    color: #fff;
    background: rgb(33, 34, 56);
    box-shadow: 0 2px 8px rgba(33, 34, 56, 0.5);
    font-weight: 600;
    transform: scale(1.02);
    
}

.ppi-segment input:checked + .ppi-segment-label {
    opacity: 0.9;
}

/* Select Controls */
.ppi-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.ppi-select:hover {
    border-color: #00aeef;
}

.ppi-select:focus {
    outline: none;
    border-color: #00aeef;
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}

/* Apply Button */
.ppi-search-submit {
    flex: 0 0 auto;
}

.ppi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ppi-btn-primary {
    color: #fff;
    background: rgb(33, 34, 56);
    box-shadow: 0 2px 4px rgba(33, 34, 56, 0.3);
}

.ppi-btn-primary:hover {
    background: rgb(45, 46, 70);
    box-shadow: 0 4px 8px rgba(33, 34, 56, 0.4);
    transform: translateY(-1px);
}

.ppi-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(33, 34, 56, 0.3);
}

/* Active state when filters have changed */
.ppi-btn-primary.ppi-btn-active {
    background: #ff6b35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.ppi-btn-primary.ppi-btn-active:hover {
    background: #e85a2a;
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 6px 16px rgba(255, 107, 53, 0.6);
    }
}

.ppi-btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Mobile Responsive (< 992px) */
@media (max-width: 991px) {
    .ppi-landing-search {
        margin: 16px 0 20px;
        padding: 12px;
    }
    
    .ppi-search-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .ppi-search-control {
        width: 100%;
        min-width: 100%;
    }
    
    .ppi-segmented-control {
        flex-wrap: wrap;
    }
    
    .ppi-segment {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
    
    .ppi-segment-label {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .ppi-search-submit {
        width: 100%;
    }
    
    .ppi-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .ppi-search-row {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .ppi-facade-switch {
        flex: 1 1 100%;
    }
    
    .ppi-type-select,
    .ppi-rooms-select {
        flex: 1 1 calc(50% - 6px);
    }
    
    .ppi-search-submit {
        flex: 1 1 100%;
    }
}

/* Hide theme default search on landing pages */
.ppi-landing-active .advanced-search,
.ppi-landing-active .page-title-search {
    display: none !important;
}

