/* ============================================================ */
/* WebLab PWA Suite - Frontend Styles                           */
/* ============================================================ */

/* --- INSTALL BANNER (Bottom Sheet Style) --- */
#afpwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    animation: afpwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.afpwa-banner-inner {
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)); /* Suport iPhone notch */
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Butonul de închidere (X) */
.afpwa-banner-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f0f0f1;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #646970;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.afpwa-banner-close:hover {
    background: #e0e0e0;
}

/* Titlul */
.afpwa-banner-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    margin-right: 35px; /* loc pentru butonul X */
}

/* Lista cu avantaje */
.afpwa-banner-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.afpwa-bullet {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #50575e;
}

.afpwa-bullet-icon {
    margin-right: 12px;
    font-size: 20px;
    line-height: 1;
}

/* Container butoane */
.afpwa-banner-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Butonul principal (Install) */
.afpwa-banner-install {
    flex: 1;
    background: #2271b1;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.afpwa-banner-install:active {
    background: #135e96;
    transform: scale(0.98);
}

.afpwa-banner-install:disabled {
    background: #a7aaad;
    cursor: not-allowed;
}

/* Butonul secundar (Later) */
.afpwa-banner-later {
    background: transparent;
    color: #646970;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.afpwa-banner-later:hover {
    color: #1d2327;
}

/* Iconița aplicației */
#afpwa-install-banner img {
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}

.afpwa-banner-icon-placeholder {
    width: 64px;
    height: 64px;
    background: #f0f0f1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 8px;
}

/* --- ANIMAȚII --- */
@keyframes afpwaSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.afpwa-banner-hiding {
    animation: afpwaSlideDown 0.3s ease-in forwards;
}

@keyframes afpwaSlideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

/* --- DARK MODE --- */
@media (prefers-color-scheme: dark) {
    .afpwa-banner-inner {
        background: #1d2327;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }
    .afpwa-banner-title { color: #ffffff; }
    .afpwa-bullet { color: #c3c4c7; }
    .afpwa-banner-close { background: #2c3338; color: #c3c4c7; }
    .afpwa-banner-close:hover { background: #3c434a; }
    .afpwa-banner-icon-placeholder { background: #2c3338; }
    .afpwa-banner-install { background: #135e96; }
    .afpwa-banner-later { color: #c3c4c7; }
    .afpwa-banner-later:hover { color: #ffffff; }
}

/* --- ALTE ELEMENTE (QR, Connectivity, etc.) --- */
.afpwa-qr-install .afpwa-qr-wrapper svg { 
    display: block; 
    max-width: 100%; 
    height: auto; 
}
.afpwa-qr-install .afpwa-qr-caption { 
    font-family: -apple-system, sans-serif; 
    margin-top: 10px;
    font-size: 13px;
    color: #646970;
}
/* ============================================================ */
/* DESIGN MODAL INSTRUCTIUNI (Apare la click pe Install)        */
/* ============================================================ */
#afpwa-install-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.afpwa-modal-panel {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    z-index: 1;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: afpwaZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.afpwa-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0f0f1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #646970;
}

.afpwa-modal-header h2 {
    margin: 0 0 16px 0;
    font-size: 22px;
    color: #1d2327;
}

.afpwa-modal-body {
    text-align: left;
    font-size: 15px;
    color: #50575e;
    line-height: 1.6;
}

.afpwa-modal-body p { margin: 0 0 10px 0; }
.afpwa-modal-body ol { padding-left: 24px; margin: 0 0 16px 0; }
.afpwa-modal-body li { margin-bottom: 8px; }
.afpwa-note { font-size: 13px; color: #8c8f94; font-style: italic; }

@keyframes afpwaZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (prefers-color-scheme: dark) {
    .afpwa-modal-panel { background: #1d2327; }
    .afpwa-modal-header h2 { color: #ffffff; }
    .afpwa-modal-body { color: #c3c4c7; }
    .afpwa-modal-close { background: #2c3338; color: #c3c4c7; }
}