/**
 * PWA Styles - Share and Install UI Components
 */

/* ================================
   SHARE BUTTON
   ================================ */
.share-btn-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #1a1a2e;
    color: #d4a574;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-btn-main:hover {
    background: #d4a574;
    color: #1a1a2e;
}

.share-btn-main svg {
    width: 18px;
    height: 18px;
}

/* ================================
   INSTALL APP BUTTON
   ================================ */
.install-app-btn {
    display: none; /* Hidden by default, shown via JS when install available */
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #d4a574 0%, #c49a6c 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.install-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.install-app-btn svg {
    width: 18px;
    height: 18px;
}

/* ================================
   SHARE MODAL
   ================================ */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.share-modal.closing {
    opacity: 0;
}

.share-modal.closing .share-modal-content {
    animation: modalPopOut 0.3s ease forwards !important;
}

@keyframes modalPopOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
}

.share-modal.closing .share-modal-overlay {
    animation: overlayFadeOut 0.3s ease forwards !important;
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: modalPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(30px);
    }
    70% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth overlay fade */
.share-modal-overlay {
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.share-modal-content h3 {
    margin: 0 0 20px;
    color: #1a1a2e;
    font-size: 20px;
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.02);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.twitter {
    background: #000000;
}

.share-btn.email {
    background: #757575;
}

.share-modal-close {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.share-modal-close:hover {
    background: #e0e0e0;
}

/* ================================
   TOAST NOTIFICATION
   ================================ */
.pwa-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a2e;
    color: #d4a574;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.pwa-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Note: PWA buttons are now in header nav-actions, no floating buttons needed */

/* ================================
   DARK MODE SUPPORT
   ================================ */
@media (prefers-color-scheme: dark) {
    .share-modal-content {
        background: #1a1a2e;
        color: white;
    }

    .share-modal-content h3 {
        color: #d4a574;
    }

    .share-modal-close {
        background: #2a2a3e;
        color: #ccc;
    }

    .share-modal-close:hover {
        background: #3a3a4e;
    }
}

/* ================================
   RESPONSIVE ADJUSTMENTS
   ================================ */
@media (max-width: 480px) {
    .share-buttons {
        grid-template-columns: 1fr;
    }
}
