/* ===========================================
   Posteasy CSS — WordPress/Divi 5 Compatible
   Namespace: .posteasy-app
   =========================================== */

/* Variables globales Posteasy */
:root {
    --pe-primary: #00e1ff;
    --pe-secondary: #0055A4;
    --pe-dark: #003366;
    --pe-light: #F0F4F8;
    --pe-white: #FFFFFF;
    --pe-accent: #E63946;
    --pe-font: 'Outfit', sans-serif;
}

/* Container Posteasy (évite conflit avec .container Divi) */
.posteasy-app {
    font-family: var(--pe-font);
    color: var(--pe-dark);
    line-height: 1.6;
}

.posteasy-app .pe-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===================== */
/* MODULE: Suivi de Colis */
/* ===================== */
.posteasy-app .tracking-container {
    padding: 60px 0;
    background: var(--pe-light);
    min-height: 60vh;
}

.posteasy-app .tracking-card {
    background: var(--pe-white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.posteasy-app .search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.posteasy-app .search-box input {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid #eee;
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: var(--pe-font);
    transition: border-color 0.3s;
}

.posteasy-app .search-box input:focus {
    outline: none;
    border-color: var(--pe-primary);
}

.posteasy-app .btn-track {
    background: var(--pe-primary);
    color: var(--pe-dark);
    border: none;
    padding: 0 30px;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.posteasy-app .btn-track:hover {
    transform: translateY(-3px);
}

.posteasy-app .tracking-result {
    display: none;
    margin-top: 40px;
    animation: pe-fadeInUp 0.5s ease-out;
}

.posteasy-app .tracking-result.active {
    display: block;
}

.posteasy-app .shipment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.posteasy-app .shipment-id {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pe-secondary);
}

.posteasy-app .shipment-status {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.posteasy-app .timeline {
    position: relative;
    padding: 20px 0;
    margin-left: 20px;
}

.posteasy-app .timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #eee;
}

.posteasy-app .timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 30px;
}

.posteasy-app .timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: 3px solid var(--pe-white);
    z-index: 1;
}

.posteasy-app .timeline-item.completed::before { background: var(--pe-primary); }
.posteasy-app .timeline-item.active::before {
    background: var(--pe-primary);
    box-shadow: 0 0 0 5px rgba(0, 225, 255, 0.2);
}

.posteasy-app .timeline-date { font-size: 0.85rem; color: #888; margin-bottom: 5px; }
.posteasy-app .timeline-content h4 { margin: 0 0 5px; color: var(--pe-secondary); }
.posteasy-app .timeline-content p { margin: 0; color: #666; font-size: 0.95rem; }

/* ===================== */
/* MODULE: Simulateur     */
/* ===================== */
.posteasy-app .sim-container {
    padding: 60px 0;
    background: var(--pe-light);
    min-height: 60vh;
}

.posteasy-app .sim-card {
    background: var(--pe-white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    max-width: 700px;
    margin: 0 auto;
}

.posteasy-app .form-row {
    margin-bottom: 20px;
}

.posteasy-app .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.posteasy-app .form-row input,
.posteasy-app .form-row select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-family: var(--pe-font);
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.posteasy-app .form-row input:focus,
.posteasy-app .form-row select:focus {
    outline: none;
    border-color: var(--pe-primary);
}

.posteasy-app .btn-calc {
    width: 100%;
    padding: 18px;
    background: var(--pe-secondary);
    color: var(--pe-white);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.posteasy-app .btn-calc:hover { background: var(--pe-dark); }

.posteasy-app .result-box {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, var(--pe-secondary), var(--pe-dark));
    border-radius: 16px;
    color: var(--pe-white);
    text-align: center;
    display: none;
}

.posteasy-app .result-box.show { display: block; animation: pe-fadeInUp 0.4s ease-out; }
.posteasy-app .result-box .price { display: block; font-size: 2rem; font-weight: 700; margin: 10px 0; }
.posteasy-app .result-box .details { display: block; opacity: 0.85; font-size: 0.9rem; }

.posteasy-app .autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pe-white);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 10;
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.posteasy-app .autocomplete-list.active { display: block; }

.posteasy-app .autocomplete-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    transition: background 0.2s;
}

.posteasy-app .autocomplete-item:hover { background: #f1f5f9; }

.posteasy-app .autocomplete-item .type-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(0,85,164,0.1);
    color: var(--pe-secondary);
    border-radius: 50px;
    font-weight: 600;
}

/* ===================== */
/* MODULE: Section Header */
/* ===================== */
.posteasy-app .section-header h1,
.posteasy-app .section-header h2 {
    font-weight: 700;
    color: var(--pe-dark);
}

.posteasy-app .section-header .line {
    width: 60px;
    height: 4px;
    background: var(--pe-primary);
    border-radius: 2px;
    margin: 10px auto;
}

/* ===================== */
/* Utilitaires            */
/* ===================== */
.posteasy-app .loader {
    display: none;
    text-align: center;
    padding: 40px;
}

.posteasy-app .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--pe-primary);
    border-radius: 50%;
    animation: pe-spin 1s linear infinite;
    margin: 0 auto 15px;
}

.posteasy-app .info-note {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    margin-top: 20px;
}

@keyframes pe-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pe-fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
    .posteasy-app .search-box { flex-direction: column; }
    .posteasy-app .search-box .btn-track { padding: 15px; }
    .posteasy-app .tracking-card { padding: 25px; }
    .posteasy-app .sim-card { padding: 25px; }
}
