/* ============================================
   MyFly eSIM - Frontend Styles
   Dashboard "Mes eSIM" + Product Page
   ============================================ */

/* ─── Dashboard Grid ─────────────────────── */
.myfly-esim-dashboard h2 {
    margin-bottom: 1.5rem;
    font-size: 1.4em;
}

.myfly-esim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.myfly-esim-empty {
    text-align: center;
    padding: 3rem 1rem;
}
.myfly-esim-empty p {
    margin-bottom: 1rem;
    color: #666;
}

/* ─── eSIM Card ──────────────────────────── */
.myfly-esim-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.myfly-esim-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.myfly-esim-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}
.myfly-esim-card__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.myfly-esim-card__product {
    font-size: 1.05em;
    color: #1c4431;
    line-height: 1.3;
}
.myfly-esim-card__order {
    font-size: 0.8em;
    color: #999;
}

/* ─── Status Badges ──────────────────────── */
.myfly-esim-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.myfly-esim-badge--assigned  { background: #d4edda; color: #155724; }
.myfly-esim-badge--free      { background: #e2e3e5; color: #383d41; }
.myfly-esim-badge--reserved  { background: #fff3cd; color: #856404; }
.myfly-esim-badge--suspended { background: #f8d7da; color: #721c24; }
.myfly-esim-badge--expired   { background: #e2e3e5; color: #6c757d; }
.myfly-esim-badge--deleted   { background: #f5c6cb; color: #721c24; }

/* ─── Card Details ───────────────────────── */
.myfly-esim-card__details {
    margin-bottom: 1rem;
}
.myfly-esim-card__field {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}
.myfly-esim-card__field:last-child {
    border-bottom: none;
}
.myfly-esim-card__label {
    color: #888;
    font-weight: 500;
}
.myfly-esim-card__value code {
    font-size: 0.85em;
    background: #f8f8f8;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ─── QR Code ────────────────────────────── */
.myfly-esim-card__qr-toggle {
    text-align: center;
    padding: 0.5rem 0 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.5rem;
}
.myfly-esim-qr-toggle-btn {
    font-size: 0.85em;
    padding: 0.4rem 0.9rem;
}
.myfly-esim-card__qr {
    text-align: center;
    padding: 0.75rem 0;
}
.myfly-esim-card__qr img {
    max-width: 160px;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    margin-bottom: 0.75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Consumption Bar ────────────────────── */
.myfly-esim-card__consumption {
    padding: 0.75rem 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.5rem;
}
.myfly-esim-loading {
    color: #999;
    font-size: 0.85em;
    text-align: center;
    padding: 0.5rem 0;
}

.myfly-conso {
    margin: 0;
}
.myfly-conso__label {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.myfly-conso__track {
    position: relative;
    height: 22px;
    background: #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.myfly-conso__fill {
    height: 100%;
    border-radius: 6px;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.8em;
    line-height: 22px;
    transition: width 0.5s ease;
    min-width: 30px;
}
.myfly-conso__fill--ok      { background: #72b68d; }
.myfly-conso__fill--warning  { background: #f0ad4e; }
.myfly-conso__fill--danger   { background: #d9534f; }

.myfly-conso__text {
    font-size: 0.85em;
    color: #555;
    margin-top: 0.3rem;
    text-align: center;
}
.myfly-conso__dates {
    font-size: 0.8em;
    color: #888;
    margin-top: 0.3rem;
}

/* ─── Action Buttons ─────────────────────── */
.myfly-esim-card__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.5rem;
}

.myfly-esim-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
    color: #333;
    line-height: 1.4;
}
.myfly-esim-btn:hover {
    background: #f5f5f5;
}
.myfly-esim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.myfly-esim-btn--primary {
    background: #72b68d;
    color: #fff;
    border-color: #72b68d;
}
.myfly-esim-btn--primary:hover {
    background: #5ca177;
}
.myfly-esim-btn--secondary {
    background: #f8f8f8;
    border-color: #ccc;
}
.myfly-esim-btn--secondary:hover {
    background: #eee;
}
.myfly-esim-btn--warning {
    background: #f0ad4e;
    color: #fff;
    border-color: #f0ad4e;
}
.myfly-esim-btn--warning:hover {
    background: #ec971f;
}
.myfly-esim-btn--danger {
    background: #d9534f;
    color: #fff;
    border-color: #d9534f;
}
.myfly-esim-btn--danger:hover {
    background: #c9302c;
}

/* ─── Notification Toast ─────────────────── */
.myfly-esim-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}
.myfly-esim-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.myfly-esim-toast--success { background: #28a745; }
.myfly-esim-toast--error   { background: #dc3545; }

/* ─── Responsive ─────────────────────────── */
@media (max-width: 480px) {
    .myfly-esim-grid {
        grid-template-columns: 1fr;
    }
    .myfly-esim-card__header {
        flex-direction: column;
        gap: 0.5rem;
    }
    .myfly-esim-card__field {
        flex-direction: column;
        gap: 2px;
    }
    .myfly-esim-card__actions {
        flex-direction: column;
    }
    .myfly-esim-btn {
        width: 100%;
    }
}

/* ============================================
   Product Page Styles (ex-functions.php)
   ============================================ */

/* ─── Plan Selector Cards ────────────────── */
.esim-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.esim-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .75rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    text-align: left;
    transition: all .3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,.03);
}
.esim-card:hover {
    border-color: #72b58d;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
}
.esim-card-content h4 {
    margin: .5rem 0;
    font-size: 1.25rem;
    color: #1c4431;
}
.esim-card-content .prix {
    font-weight: 700;
    color: #1c4431;
}
.choose-plan {
    align-self: stretch;
    background: #72b58d;
    color: #fff;
    border: none;
    padding: .75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: background .2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
}
.choose-plan:hover {
    background: #5ca177;
}
.esim-btn-icon {
    font-size: 1.1em;
}

/* ─── Tabs ───────────────────────────────── */
.tabs-container {
    font-family: "Segoe UI", sans-serif;
    max-width: 500px;
    margin: 30px auto;
}
.tabs-header {
    display: flex;
    background-color: #72b68d;
    border-radius: 12px;
    overflow: hidden;
    padding: 5px;
}
.tab-btn {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.3s, color 0.3s;
    color: #111;
}
.tab-btn.active {
    background: #fff;
    border: 1px solid #e1e1e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.tab-content {
    display: none;
    padding: 20px 10px;
    font-size: 16px;
}
.tab-content.active {
    display: block;
}
.tab-content ul {
    list-style: none;
    padding: 0;
}
.tab-content li {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}
.tab-content li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ─── eSIM 4 Steps Block ────────────────── */
.esim-steps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px 20px;
    background-color: #f9fafb;
    border-radius: 16px;
    margin: 60px auto;
    max-width: 1100px;
}
.esim-step {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.esim-img img {
    width: 80px;
    height: auto;
}
.esim-text {
    flex: 1;
}
.esim-text p {
    margin: 0;
    font-size: 16px;
    color: #111827;
}
.esim-btn {
    margin-top: 10px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    color: #333;
    display: inline-block;
}
.esim-btn:hover {
    background-color: #f0f0f0;
}
.esim-number {
    bottom: 16px;
    left: 16px;
    background: #72b68d;
    color: #000;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
}

/* ─── FAQ ────────────────────────────────── */
.titre-faq {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4e5e6e;
    font-size: 30px;
}
.custom-faq {
    max-width: 900px;
    margin: 30px auto;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.custom-faq-column {
    flex: 1 1 45%;
    min-width: 300px;
}
.custom-faq .faq-item {
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
}
.custom-faq .faq-title {
    font-weight: 600;
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}
.custom-faq .faq-title::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    transition: transform 0.3s;
}
.custom-faq .faq-item.active .faq-title::after {
    content: '-';
    transform: rotate(180deg);
}
.custom-faq .faq-content {
    display: none;
    padding-top: 10px;
    color: #333;
}
.custom-faq .faq-item.active .faq-content {
    display: block;
}
