/* Simple PWA Styles */

/* Install Prompt Styles */

/* Slide-in from right animation */
@keyframes pwa-slide-in-right {
    0% { transform: translateX(120%); opacity: 0; }
    60% { transform: translateX(-6%); opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

.pwa-install-prompt {
    position: fixed;
    top: 75px;
    left: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    max-width: 400px;
    margin: 0 auto;
}

.pwa-install-prompt.show {
    animation: pwa-slide-in-right 380ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.pwa-install-prompt.hidden {
    display: none;
}

.pwa-prompt-content {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-prompt-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-prompt-icon img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.pwa-prompt-text {
    flex: 1;
    min-width: 0;
}

.pwa-prompt-text h3 {
    margin: 0 0 0px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.pwa-prompt-text p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.pwa-prompt-buttons {
    display: flex;
    gap: 0px;
    margin-top: 0px;
    flex-wrap: wrap;
}

.pwa-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 70px;
}

.pwa-btn-primary {
    background: #2196F3;
    color: white;
}

.pwa-btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.pwa-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.pwa-btn-secondary:hover {
    background: #e0e0e0;
}

.pwa-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.pwa-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* iOS Install Modal */
.pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pwa-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.pwa-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.ios-instructions {
    text-align: left;
    margin-bottom: 20px;
}

.ios-instructions p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
}

.ios-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.ios-instructions li {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* Android Instructions Styling */
.android-instructions {
    text-align: left;
    margin-bottom: 20px;
}

.android-instructions p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
}

.android-instructions ol {
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.android-instructions li {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.android-benefits {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.android-benefits h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.android-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.android-benefits li {
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
}

/* Waiting Modal Styles */
.pwa-waiting-content {
    text-align: center;
    padding: 20px;
}

.pwa-waiting-content h3 {
    margin: 16px 0 8px 0;
    color: #333;
    font-size: 18px;
}

.pwa-waiting-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Spinner Animation */
.pwa-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: pwa-spin 1s linear infinite;
}

@keyframes pwa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shortcut Success Modal Styles */
.pwa-shortcut-content {
    text-align: center;
    padding: 25px;
}

.pwa-shortcut-content h3 {
    margin: 16px 0 12px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.pwa-shortcut-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.4;
}

.pwa-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.pwa-shortcut-content .pwa-spinner {
    margin: 20px auto 0 auto;
}

.pwa-shortcut-content .pwa-btn {
    margin-top: 15px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Guided Installation Styles */
.pwa-guided-content {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.pwa-guided-header {
    text-align: center;
    margin-bottom: 25px;
}

.pwa-guided-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pwa-guided-header h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.pwa-guided-header p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* Guided Steps */
.pwa-guided-steps {
    margin-bottom: 25px;
}

.pwa-step {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    opacity: 0.4;
    transition: all 0.3s ease;
    border-left: 3px solid #e0e0e0;
    padding-left: 15px;
    margin-bottom: 15px;
}

.pwa-step-active {
    opacity: 1;
    border-left-color: #2196F3;
    transform: translateX(5px);
}

.pwa-step-number {
    background: #2196F3;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 15px;
    margin-top: 2px;
}

.pwa-step:not(.pwa-step-active) .pwa-step-number {
    background: #ccc;
}

.pwa-step-content {
    flex: 1;
}

.pwa-step-content strong {
    display: block;
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
}

.pwa-step-visual {
    margin-top: 12px;
}

/* Browser Bar Simulation */
.pwa-browser-bar {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.pwa-address-bar {
    flex: 1;
    color: #666;
}

.pwa-menu-dots, .pwa-menu-icon {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-left: 10px;
}

/* Menu Item Simulation */
.pwa-menu-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
    color: #333;
    margin-top: 8px;
}

.pwa-install-option {
    background: #e3f2fd;
    border-color: #2196F3;
    color: #1976D2;
    font-weight: 500;
}

/* Install Popup Simulation */
.pwa-install-popup {
    background: white;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.pwa-popup-content {
    text-align: center;
}

.pwa-popup-content strong {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
}

.pwa-popup-btn {
    padding: 8px 16px;
    margin: 0 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.pwa-popup-install {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.pwa-popup-cancel {
    background: white;
    color: #666;
}

/* Guided Footer */
.pwa-guided-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pwa-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.pwa-btn-secondary:hover {
    background: #eeeeee;
}

/* Completion Benefits */
.pwa-completion-benefits {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.pwa-completion-benefits h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.pwa-completion-benefits ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.pwa-completion-benefits li {
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.share-icon {
    display: inline-block;
    background: #007AFF;
    color: white;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    margin: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
    .pwa-install-prompt {
        left: 10px;
        right: 10px;
        top: 75px;
    }
    
    .pwa-prompt-content {
        padding: 10px;
        gap: 8px;
    }
    
    .pwa-prompt-text h3 {
        font-size: 13px;
    }
    
    .pwa-prompt-text p {
        font-size: 11px;
    }
    
    .pwa-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .pwa-prompt-buttons {
        gap: 0px;
        margin-top: 0px;
    }
}

@media (max-width: 360px) {
    .pwa-close-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
        margin-left: 6px;
    }
    
    .pwa-prompt-buttons {
        gap: 0px;
    }
}

/* Force dark theme styles (apply always) */
.pwa-install-prompt {
    background: #2d2d2d;
    color: #ffffff;
}

.pwa-prompt-text h3 {
    color: #ffffff;
}

.pwa-prompt-text p {
    color: #cccccc;
}

.pwa-btn-secondary {
    background: #404040;
    color: #cccccc;
}

.pwa-btn-secondary:hover {
    background: #505050;
}

.pwa-close-btn {
    background: #404040;
    color: #cccccc;
}

.pwa-close-btn:hover {
    background: #505050;
    color: #ffffff;
}

.pwa-modal-content {
    background: #2d2d2d;
    color: #ffffff;
}

.pwa-modal-content h3 {
    color: #ffffff;
}

.ios-instructions p {
    color: #cccccc;
}

.ios-instructions li {
    color: #ffffff;
}

/* New iOS Install Modal Styles */
.pwa-modal-content-ios {
    background: #2d2d2d;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

.pwa-modal-header-ios {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #404040;
}

.pwa-modal-title-ios {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.pwa-modal-close-ios {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #cccccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0;
}

.pwa-modal-close-ios:hover {
    background: #404040;
    color: #ffffff;
}

.pwa-modal-close-ios svg {
    width: 20px;
    height: 20px;
}

.pwa-modal-details-ios {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #252525;
}

.pwa-modal-img-ios {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.pwa-modal-img-ios.bordered {
    border-radius: 12px;
    overflow: hidden;
}

.pwa-modal-img-ios img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pwa-modal-text-ios {
    flex: 1;
    min-width: 0;
}

.pwa-modal-text-ios > div:first-child {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.pwa-modal-text-ios > div:last-child {
    font-size: 13px;
    color: #999999;
}

.pwa-modal-steps-ios {
    padding: 20px;
}

.pwa-modal-step-ios {
    position: relative;
    padding-left: 32px;
    margin-bottom: 24px;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
}

.pwa-modal-step-ios:last-child {
    margin-bottom: 0;
}

.pwa-modal-step-ios::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: #ffffff;
}

.pwa-modal-step-ios > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.apple-share-sheet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #404040;
    border-radius: 6px;
    padding: 4px;
    margin: 0 4px;
}

.apple-share-sheet-icon svg,
.apple-share-sheet-icon img {
    display: block;
}

.add-to-homescreen-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #404040;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.add-to-homescreen-text svg,
.add-to-homescreen-text img {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.pwa-inline-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    vertical-align: middle;
    margin: 0 4px;
}

/* Responsive adjustments for iOS modal */
@media (max-width: 480px) {
    .pwa-modal-content-ios {
        max-width: calc(100vw - 40px);
    }
    
    .pwa-modal-details-ios {
        padding: 16px;
    }
    
    .pwa-modal-steps-ios {
        padding: 16px;
    }
    
    .pwa-modal-step-ios {
        font-size: 14px;
        margin-bottom: 20px;
    }
}

/* ========================================
   Android Modal Styles (new compact design)
   ======================================== */

.pwa-modal-content-android {
    background: #2d2d2d;
    border-radius: 12px;
    max-width: 340px;
    width: 100%;
    overflow: hidden;
}

.pwa-modal-header-android {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #404040;
}

.pwa-modal-title-android {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.pwa-modal-close-android {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #cccccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0;
}

.pwa-modal-close-android:hover {
    background: #404040;
    color: #ffffff;
}

.pwa-modal-close-android svg {
    width: 20px;
    height: 20px;
}

.pwa-guided-content-android {
    padding: 20px;
}

.pwa-guided-steps-android {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pwa-step-android {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.pwa-step-number-android {
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: #2196F3;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.pwa-step-content-android {
    flex: 1;
}

.pwa-step-title-android {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
}

.pwa-step-visual-android {
    margin-top: 8px;
}

.pwa-browser-bar-android {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 10px 14px;
    gap: 12px;
}

.pwa-address-bar-android {
    flex: 1;
    color: #888888;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-menu-dots-android,
.pwa-menu-icon-android {
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-menu-item-android {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a1a;
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 14px;
}

.pwa-menu-item-android svg {
    color: #2196F3;
    flex-shrink: 0;
}

/* Preferred menu item (for "Install app" option) */
.pwa-menu-item-preferred {
    background: #1a3a1a;
    border-color: #34A853;
}

.pwa-menu-item-preferred svg {
    color: #34A853;
}

/* Step description for fallback instructions */
.pwa-step-description-android {
    color: #888888;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    font-style: italic;
}

/* Responsive adjustments for Android modal */
@media (max-width: 480px) {
    .pwa-modal-content-android {
        max-width: calc(100vw - 40px);
    }
    
    .pwa-guided-content-android {
        padding: 16px;
    }
    
    .pwa-step-title-android {
        font-size: 14px;
    }
}

/* ========================================
   Fix contrast issues in guided modal
   ======================================== */

.pwa-guided-header h3 {
    color: #ffffff;
}

.pwa-guided-header p {
    color: #cccccc;
}

.pwa-step-content strong {
    color: #ffffff;
}

.pwa-completion-benefits h4 {
    color: #ffffff;
}

.pwa-completion-benefits li {
    color: #cccccc;
}

/* Make success icon SVG display properly */
.pwa-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-success-icon svg {
    display: block;
}
