/* --------------------------------------------------------------
   PWA Installation Prompt Styles
-------------------------------------------------------------- */

/* PWA Installation Prompt */
.wallahi-homepage .pwa-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    text-align: center;
    display: none;
    border: 2px solid #ff3366;
}

.wallahi-homepage .pwa-prompt.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.wallahi-homepage .pwa-prompt h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2rem;
}

.wallahi-homepage .pwa-prompt p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.wallahi-homepage .pwa-prompt-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.wallahi-homepage .pwa-install-btn {
    background: linear-gradient(to right, #e700c7, #fd1d1d);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s;
}

.wallahi-homepage .pwa-install-btn:hover {
    transform: translateY(-2px);
}

.wallahi-homepage .pwa-later-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    flex: 1;
}

.wallahi-homepage .pwa-features {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.wallahi-homepage .pwa-feature {
    text-align: center;
    font-size: 0.8rem;
}

.wallahi-homepage .pwa-feature span {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

/* Mobile specific PWA styles */
@media (max-width: 767px) {
    .wallahi-homepage .pwa-prompt {
        bottom: 10px;
        padding: 15px;
    }
    
    .wallahi-homepage .pwa-prompt-buttons {
        flex-direction: column;
    }
}

/* PWA Open Banner Styles */
body.has-pwa-banner {
    padding-top: 60px;
}

/* Hide install prompt in standalone mode */
.pwa-standalone .pwa-prompt {
    display: none !important;
}

/* --------------------------------------------------------------
   PWA Banner Styles - Instructions Focused (FINAL)
-------------------------------------------------------------- */

.wallahi-homepage .pwa-open-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff3366, #e700c7);
    color: white;
    padding: 8px 15px;
    z-index: 10001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px; /* space between sections */
    flex-wrap: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    min-height: 45px;
}

/* Expanded state - shows instructions */
.wallahi-homepage .pwa-open-banner.expanded {
    padding: 15px;
    align-items: flex-start;
    min-height: 120px;
}

/* Content (icon + text) */
.wallahi-homepage .pwa-open-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    margin-right: 10px;
}

.wallahi-homepage .pwa-open-banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.wallahi-homepage .pwa-open-banner-text {
    flex: 1;
    text-align: left;
}

.wallahi-homepage .pwa-open-banner-text strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.wallahi-homepage .pwa-open-banner-text span {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Instructions - hidden by default */
.wallahi-homepage .pwa-open-banner-instructions {
    margin-top: 8px;
    display: none;
}

.wallahi-homepage .pwa-open-banner.expanded .pwa-open-banner-instructions {
    display: block;
    animation: fadeIn 0.3s ease;
}

.wallahi-homepage .instructions-steps {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.4;
}

.wallahi-homepage .instructions-steps strong {
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: block;
}

.wallahi-homepage .instructions-steps .step {
    margin-bottom: 2px;
}

/* --------------------------------------------------------------
   Buttons
-------------------------------------------------------------- */

.wallahi-homepage .pwa-banner-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Install Button */
.wallahi-homepage .pwa-install-btn {
    background: white;
    color: #ff3366;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.75rem;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.wallahi-homepage .pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Later Button */
.wallahi-homepage .pwa-later-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.7rem;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.wallahi-homepage .pwa-later-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* --------------------------------------------------------------
   Close Button - FIXED CENTERING
-------------------------------------------------------------- */

.wallahi-homepage .pwa-close-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    position: static;
    margin-left: 10px;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.wallahi-homepage .pwa-open-banner.expanded .pwa-close-btn {
    display: flex;
    align-self: flex-start;
}

.wallahi-homepage .pwa-close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* --------------------------------------------------------------
   Body Padding Adjustments
-------------------------------------------------------------- */

body.has-pwa-banner {
    padding-top: 45px;
}

body.has-pwa-banner .wallahi-homepage {
    padding-top: 45px;
}

body.has-pwa-banner.expanded-banner {
    padding-top: 120px;
}

body.has-pwa-banner.expanded-banner .wallahi-homepage {
    padding-top: 120px;
}

/* --------------------------------------------------------------
   Mobile Responsive
-------------------------------------------------------------- */

@media (max-width: 767px) {
    .wallahi-homepage .pwa-open-banner {
        padding: 6px 12px;
        min-height: 42px;
        gap: 8px;
    }

    .wallahi-homepage .pwa-open-banner.expanded {
        padding: 12px;
        min-height: 110px;
    }

    .wallahi-homepage .pwa-banner-buttons {
        flex-direction: row;
        gap: 6px;
    }

    .wallahi-homepage .pwa-install-btn,
    .wallahi-homepage .pwa-later-btn {
        height: 24px;
        font-size: 0.65rem;
        padding: 4px 8px;
        min-width: 55px;
    }

    .wallahi-homepage .pwa-close-btn {
        width: 22px;
        height: 22px;
        font-size: 14px;
        margin-left: 8px;
    }

    body.has-pwa-banner {
        padding-top: 42px;
    }

    body.has-pwa-banner.expanded-banner {
        padding-top: 110px;
    }
}

/* --------------------------------------------------------------
   PWA Banner Prevention - Desktop & Standalone Modes
-------------------------------------------------------------- */

/* Hide banner on desktop by default - prevents FOUC */
@media (min-width: 769px) {
  .pwa-open-banner {
    display: none !important;
  }
  
  /* Reset body padding on desktop */
  body.has-pwa-banner {
    padding-top: 0 !important;
  }
}

/* Hide banner in PWA standalone mode - most reliable method */
@media all and (display-mode: standalone) {
  .pwa-open-banner {
    display: none !important;
  }
  
  /* Reset body padding in PWA mode */
  body.has-pwa-banner {
    padding-top: 0 !important;
  }
}

/* Hide banner for iOS standalone mode */
@media all and (display-mode: standalone) {
  .pwa-open-banner {
    display: none !important;
  }
}

/* Default state - hidden, shown only by JS for mobile browsers */
.pwa-open-banner {
  display: none;
}

/* --------------------------------------------------------------
   Improved PWA Instructions Styling - FIXED ALIGNMENT
-------------------------------------------------------------- */

.wallahi-homepage .pwa-open-banner-instructions {
    margin-top: 12px;
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%; /* Take full width of banner */
    box-sizing: border-box;
}

.wallahi-homepage .pwa-open-banner.expanded .pwa-open-banner-instructions {
    display: block;
    animation: slideDownFade 0.4s ease-out;
}

.wallahi-homepage .instructions-steps {
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    text-align: center; /* Center the content */
    width: 100%;
}

.wallahi-homepage .instructions-steps strong {
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: block;
    color: white;
    font-weight: 600;
}

.wallahi-homepage .instructions-steps .step {
    margin-bottom: 6px;
    display: flex;
    justify-content: center; /* Center the step content */
    align-items: center;
    text-align: left;
    gap: 8px;
}

.wallahi-homepage .instructions-steps .platform {
    display: inline-block;
    font-weight: 600;
    color: #ffeb3b;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.wallahi-homepage .instructions-steps .instruction {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    max-width: 200px;
}

/* Platform-specific colors */
.wallahi-homepage .instructions-steps .android {
    color: #a4c639; /* Android green */
}

.wallahi-homepage .instructions-steps .ios {
    color: #007aff; /* iOS blue */
}

/* Fix banner content layout */
.wallahi-homepage .pwa-open-banner.expanded .pwa-open-banner-content {
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    width: 100%;
    margin-right: 0;
}

.wallahi-homepage .pwa-open-banner.expanded .pwa-open-banner-text {
    width: 100%;
    text-align: center;
}

/* Animation for instructions */
@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Better banner layout when expanded */
.wallahi-homepage .pwa-open-banner.expanded {
    padding: 15px;
    align-items: center; /* Center items vertically */
    min-height: 160px;
    flex-direction: column; /* Stack content vertically */
}

/* Adjust buttons position in expanded state */
.wallahi-homepage .pwa-open-banner.expanded .pwa-banner-buttons {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

/* Close button positioning in expanded state */
.wallahi-homepage .pwa-open-banner.expanded .pwa-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    margin-left: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .wallahi-homepage .instructions-steps .step {
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }
    
    .wallahi-homepage .instructions-steps .platform {
        text-align: center;
        min-width: auto;
    }
    
    .wallahi-homepage .instructions-steps .instruction {
        text-align: center;
        max-width: none;
    }
    
    .wallahi-homepage .pwa-open-banner.expanded {
        min-height: 180px; /* Slightly taller for mobile */
    }
}

/* ==============================================================
   HELPER POPUP STYLES - ADDED FROM liked-avatars-helper.css
   ============================================================== */

/* HELPER POPUP STYLES - UPDATED TO MATCH QR DESIGN */
.helper-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(255, 255, 255); /* SOLID WHITE */
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.helper-popup-overlay.visible {
    display: flex;
}

.helper-popup-container {
    background: #000000;
    border-radius: 16px;
    max-width: 95vw;
    max-height: 95vh;
    width: 500px;
    text-align: center;
    border: 1px solid #333;
    color: white;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.helper-popup-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 16px 0;
}

.helper-popup-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.helper-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.helper-popup-close svg {
    width: 20px;
    height: 20px;
}

/* TAB SYSTEM STYLES - SIMPLIFIED TO JUST WHITE LINE */
.helper-popup-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin: 0 24px;
    background: #000000;
}

.helper-popup-tab {
    flex: 1;
    text-align: center;
    padding: 16px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.helper-popup-tab:hover {
    color: #fff;
}

/* UPDATED: Simple white line for active tab */
.helper-popup-tab.active {
    color: #fff;
    border-bottom-color: #fff; /* White line only */
    background: none; /* Remove gradient background */
}

/* MAIN CONTENT AREA */
.helper-popup-content-area {
    max-height: 500px;
    overflow-y: auto;
}

.helper-popup-tab-content {
    display: none;
    padding: 20px;
}

.helper-popup-tab-content.active {
    display: block;
}

/* CONTENT STYLES - UPDATED COLORS */
.helper-popup-content {
    padding: 10px 0;
}

/* Install App tab specific */
#tab-install-app .helper-popup-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwa-step-image-fullwidth {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* NEW: Notification image styles */
.notification-guide-image {
    margin-bottom: 20px;
}

/* NEW: Likes tab image styles */
.likes-guide-image {
    margin-bottom: 20px;
}

/* UPDATED: White highlight on image click/hover */
.pwa-step-image-fullwidth:hover,
.pwa-step-image-fullwidth:focus,
.pwa-step-image-fullwidth:active {
    border-color: #ffffff; /* White border */
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); /* White glow effect */
    outline: none;
}

/* Add active state for when image is clicked */
.pwa-step-image-fullwidth.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

/* NOTIFICATION TAB - UPDATED WITH IMAGE */
#tab-notifications .helper-popup-content {
    display: flex;
    flex-direction: column;
}

.notification-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #333;
}

.notification-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.notification-feature-text h5 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: #fff;
    font-weight: 600;
}

.notification-feature-text p {
    margin: 0;
    color: #ccc;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* LIKES TAB - UPDATED WITH IMAGE */
#tab-likes .helper-popup-content {
    display: flex;
    flex-direction: column;
}

.helper-tip-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.helper-tip-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #444;
    transform: translateY(-2px);
}

.helper-tip-item:last-child {
    margin-bottom: 0;
}

.helper-tip-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.helper-tip-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.helper-tip-text h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.helper-tip-text p {
    margin: 0;
    color: #ccc;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* FOOTER STYLES - UPDATED TO MATCH QR BUTTONS */
.helper-popup-footer {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid #333;
}

.helper-popup-ok-btn {
    background: linear-gradient(135deg, #e700c7, #fd1d1d); /* Same gradient as QR download */
    color: white;
    border: none;
    padding: 10px 20px; /* Same as QR buttons */
    border-radius: 6px; /* Same as QR buttons */
    font-size: 13px; /* Same as QR buttons */
    font-weight: 600; /* Same as QR buttons */
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px; /* Same as QR buttons */
    border: 1px solid transparent; /* Same as QR buttons */
}

.helper-popup-ok-btn:hover {
    background: linear-gradient(135deg, #fd1d1d, #e700c7); /* Same hover effect */
    transform: translateY(-1px); /* Same hover effect */
    box-shadow: 0 3px 8px rgba(231, 0, 199, 0.3); /* Same hover effect */
}

.helper-popup-ok-btn:active {
    transform: translateY(0); /* Same active state */
}

/* ============== RESPONSIVE ADJUSTMENTS ============== */
@media (max-width: 768px) {
    /* POPUP RESPONSIVE */
    .helper-popup-container {
        width: 90vw;
        max-height: 85vh;
    }
    
    .helper-popup-content-area {
        max-height: 400px;
    }
    
    .helper-popup-tabs {
        margin: 0 16px;
    }
    
    .helper-popup-tab-content {
        padding: 16px;
    }
    
    .notification-guide-image {
        margin-bottom: 16px;
    }
    
    .likes-guide-image {
        margin-bottom: 16px;
    }
    
    .notification-feature-item {
        padding: 12px;
        gap: 12px;
    }
    
    .helper-tip-item {
        padding: 12px;
        gap: 12px;
    }
    
    .helper-tip-icon {
        width: 40px;
        height: 40px;
    }
    
    /* BUTTON RESPONSIVE - MATCHES QR MOBILE */
    .helper-popup-ok-btn {
        padding: 8px 16px; /* Matches QR mobile */
        font-size: 12px; /* Matches QR mobile */
        min-width: 80px; /* Matches QR mobile */
    }
}

@media (max-width: 480px) {
    .helper-popup-overlay {
        padding: 15px;
    }
    
    .helper-popup-container {
        width: 95vw;
        max-height: 80vh;
        border-radius: 12px;
    }
    
    .helper-popup-tabs {
        margin: 0 12px;
    }
    
    .helper-popup-tab {
        padding: 12px 4px;
        font-size: 0.85rem;
    }
    
    /* Active tab mobile styles */
    .helper-popup-tab.active {
        border-bottom-width: 2px;
    }
    
    .notification-guide-image {
        margin-bottom: 12px;
    }
    
    .likes-guide-image {
        margin-bottom: 12px;
    }
    
    .notification-feature-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .notification-feature-icon {
        margin: 0 auto;
    }
    
    .helper-tip-item {
        flex-direction: column;
        text-align: center;
    }
    
    .helper-tip-icon {
        margin: 0 auto;
    }
    
    .helper-popup-footer {
        padding: 16px;
    }
    
    /* BUTTON RESPONSIVE - MATCHES QR MOBILE */
    .helper-popup-ok-btn {
        padding: 8px 16px; /* Matches QR mobile */
        font-size: 12px; /* Matches QR mobile */
        width: 100%; /* Matches QR mobile behavior */
        min-width: auto;
    }
}

/* Accessibility */
.helper-popup-close:focus,
.helper-popup-ok-btn:focus {
    outline: 2px solid #ffffff; /* White outline for focus */
    outline-offset: 2px;
}

/* Image focus state for accessibility */
.pwa-step-image-fullwidth:focus {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .helper-popup-overlay,
    .helper-popup-container,
    .helper-popup-ok-btn,
    .helper-tip-item,
    .pwa-step-image-fullwidth {
        transition: none;
    }
    
    .helper-popup-ok-btn:hover,
    .helper-tip-item:hover,
    .pwa-step-image-fullwidth:hover {
        transform: none;
    }
    
    .helper-popup-close:hover {
        transform: none;
    }
}