/* PWA Install Prompt - Fixed to Bottom */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(240, 240, 240, 0.95), rgba(255, 255, 255, 0.98));
    border: 2px solid #000000;
    border-radius: 12px;
    padding: 15px 25px;
    display: none;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 90%;
    backdrop-filter: blur(10px);
    animation: slideUp 0.4s ease-out;
    transition: all 0.3s ease;
}

body.dark-mode .pwa-install-prompt {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(0, 0, 0, 0.98));
    border-color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pwa-install-prompt.show {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.pwa-install-prompt .pwa-icon {
    font-size: 32px;
    color: #000000;
    transition: color 0.3s ease;
}

body.dark-mode .pwa-install-prompt .pwa-icon {
    color: #ffffff;
}

.pwa-install-prompt .pwa-text {
    flex: 1;
    color: #000000;
    transition: color 0.3s ease;
}

body.dark-mode .pwa-install-prompt .pwa-text {
    color: #ffffff;
}

.pwa-install-prompt .pwa-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    transition: color 0.3s ease;
}

body.dark-mode .pwa-install-prompt .pwa-text h4 {
    color: #ffffff;
}

.pwa-install-prompt .pwa-text p {
    margin: 0;
    font-size: 13px;
    color: #666666;
    transition: color 0.3s ease;
}

body.dark-mode .pwa-install-prompt .pwa-text p {
    color: #cccccc;
}

.pwa-install-prompt .pwa-buttons {
    display: flex;
    gap: 10px;
}

.pwa-install-prompt button {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.pwa-install-prompt .pwa-btn-install {
    background: #000000;
    color: #ffffff;
}

body.dark-mode .pwa-install-prompt .pwa-btn-install {
    background: #ffffff;
    color: #000000;
}

.pwa-install-prompt .pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .pwa-install-prompt .pwa-btn-install:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

.pwa-install-prompt .pwa-btn-dismiss {
    background: transparent;
    color: #666666;
    border: 1px solid #cccccc;
}

body.dark-mode .pwa-install-prompt .pwa-btn-dismiss {
    color: #999999;
    border-color: #444444;
}

.pwa-install-prompt .pwa-btn-dismiss:hover {
    color: #000000;
    border-color: #999999;
}

body.dark-mode .pwa-install-prompt .pwa-btn-dismiss:hover {
    color: #ffffff;
    border-color: #666666;
}

@media (max-width: 1200px) {
    .pwa-install-prompt {
        bottom: 140px;
    }
}

@media (max-width: 768px) {
    .pwa-install-prompt {
        bottom: 140px;
        flex-direction: column;
        text-align: center;
        padding: 18px 20px;
        gap: 15px;
        width: calc(100% - 32px);
        max-width: 380px;
    }
    
    .pwa-install-prompt .pwa-icon {
        font-size: 40px;
    }
    
    .pwa-install-prompt .pwa-text h4 {
        font-size: 18px;
        font-weight: 700;
    }
    
    .pwa-install-prompt .pwa-text p {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .pwa-install-prompt .pwa-buttons {
        width: 100%;
        gap: 10px;
    }
    
    .pwa-install-prompt button {
        flex: 1;
        padding: 12px 20px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 10px;
    }
    
    .pwa-install-prompt .pwa-btn-install {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    body.dark-mode .pwa-install-prompt .pwa-btn-install {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    }
    
    .pwa-install-prompt .pwa-btn-dismiss {
        background: rgba(0, 0, 0, 0.05);
    }

    body.dark-mode .pwa-install-prompt .pwa-btn-dismiss {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* iOS Instructions Modal */
.ios-instructions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.ios-instructions-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-instructions-content {
    background: linear-gradient(135deg, #f5f5f5, #ffffff);
    border: 2px solid #000000;
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .ios-instructions-content {
    background: linear-gradient(135deg, #1a1a1a, #000000);
    border-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ios-instructions-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #000000;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
}

body.dark-mode .ios-instructions-close {
    color: #ffffff;
}

.ios-instructions-close:hover {
    color: #666666;
    transform: rotate(90deg);
}

body.dark-mode .ios-instructions-close:hover {
    color: #cccccc;
}

.ios-instructions-content h3 {
    color: #000000;
    font-size: 22px;
    margin-bottom: 10px;
    text-align: center;
    transition: color 0.3s ease;
}

body.dark-mode .ios-instructions-content h3 {
    color: #ffffff;
}

.ios-instructions-content .subtitle {
    color: #666666;
    font-size: 14px;
    text-align: center;
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

body.dark-mode .ios-instructions-content .subtitle {
    color: #cccccc;
}

.safari-redirect-notice {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.4);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.safari-redirect-notice i {
    color: #ffa500;
    font-size: 24px;
    flex-shrink: 0;
}

.safari-redirect-notice p {
    color: #000000;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

body.dark-mode .safari-redirect-notice p {
    color: #ffffff;
}

.safari-redirect-notice strong {
    color: #000000;
    transition: color 0.3s ease;
}

body.dark-mode .safari-redirect-notice strong {
    color: #ffffff;
}

.ios-step {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

body.dark-mode .ios-step {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.ios-step-number {
    background: #000000;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 16px;
    transition: all 0.3s ease;
}

body.dark-mode .ios-step-number {
    background: #ffffff;
    color: #000000;
}

.ios-step-content h4 {
    color: #000000;
    font-size: 15px;
    margin: 0 0 8px 0;
    transition: color 0.3s ease;
}

body.dark-mode .ios-step-content h4 {
    color: #ffffff;
}

.ios-step-content p {
    color: #666666;
    font-size: 13px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

body.dark-mode .ios-step-content p {
    color: #999999;
}

.safari-share-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ios-visual-hint {
    background: #000000;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s ease;
}

body.dark-mode .ios-visual-hint {
    background: #ffffff;
}

.ios-visual-hint .safari-share-icon {
    width: 28px;
    height: 28px;
    animation: bounce 2s ease-in-out infinite;
    color: #ffffff;
}

body.dark-mode .ios-visual-hint .safari-share-icon {
    color: #000000;
}

.ios-visual-hint i {
    font-size: 28px;
    color: #ffffff;
    animation: bounce 2s ease-in-out infinite;
    transition: color 0.3s ease;
}

body.dark-mode .ios-visual-hint i {
    color: #000000;
}

.ios-visual-hint .arrow {
    font-size: 24px;
    color: #ffffff;
    font-weight: bold;
    transition: color 0.3s ease;
}

body.dark-mode .ios-visual-hint .arrow {
    color: #000000;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (max-width: 768px) {
    .ios-instructions-modal {
        padding: 12px;
    }
    
    .ios-instructions-content {
        padding: 24px 20px;
        border-radius: 16px;
        max-height: 85vh;
    }
    
    .ios-instructions-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.dark-mode .ios-instructions-close {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .ios-instructions-content h3 {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    
    .ios-instructions-content .subtitle {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    
    .safari-redirect-notice {
        padding: 12px;
        margin-bottom: 16px;
        gap: 10px;
    }
    
    .safari-redirect-notice i {
        font-size: 20px;
    }
    
    .safari-redirect-notice p {
        font-size: 12px;
    }
    
    .ios-step {
        padding: 14px;
        margin-bottom: 12px;
        gap: 12px;
    }
    
    .ios-step:hover {
        background: rgba(0, 0, 0, 0.08);
        border-color: rgba(0, 0, 0, 0.4);
        transform: translateX(4px);
    }

    body.dark-mode .ios-step:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.4);
    }
    
    .ios-step-number {
        min-width: 32px;
        height: 32px;
        font-size: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    body.dark-mode .ios-step-number {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    }
    
    .ios-step-content h4 {
        font-size: 15px;
        font-weight: 600;
    }
    
    .ios-step-content p {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .safari-share-icon {
        width: 16px;
        height: 16px;
    }
    
    .ios-visual-hint {
        padding: 20px;
        margin-top: 20px;
        border-radius: 12px;
    }
    
    .ios-visual-hint .safari-share-icon {
        width: 24px;
        height: 24px;
    }
    
    .ios-visual-hint i {
        font-size: 24px;
    }
    
    .ios-visual-hint .arrow {
        font-size: 20px;
    }
}

.ios-instructions-content::-webkit-scrollbar {
    width: 8px;
}

.ios-instructions-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

body.dark-mode .ios-instructions-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ios-instructions-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

body.dark-mode .ios-instructions-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

.ios-instructions-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

body.dark-mode .ios-instructions-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
