/* DouaneFlow - Frontend Styles */
.douaneflow-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111;
}

/* ===== RECHERCHE AVEC ICÔNE ===== */
.douaneflow-search-box {
    background: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.douaneflow-search-box h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.search-filters {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.search-wrapper {
    flex: 3;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #666;
    font-size: 18px;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46,125,50,0.1);
}

.filter-select {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #2e7d32;
}

/* ===== AUTOCOMPLÉTION ===== */
.autocomplete {
    display: none;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item strong {
    flex: 2;
    font-size: 15px;
}

.autocomplete-item .code {
    flex: 1;
    color: #666;
    font-size: 14px;
}

.autocomplete-item .operation {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ===== PRODUIT HEADER ===== */
.produit-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.produit-header h2 {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 26px;
    color: #111;
}

.code-sh {
    font-size: 16px;
    font-weight: normal;
    color: #666;
    background: #f5f5f5;
    padding: 5px 15px;
    border-radius: 20px;
}

.badge {
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.operation-import { background: #e3f2fd; color: #0d47a1; }
.operation-export { background: #e8f5e9; color: #1b5e20; }
.operation-transit { background: #fff3e0; color: #e65100; }

/* ===== ACCORDÉON ===== */
.circuits-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 16px 25px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #1e5622 !important;
}

.accordion-header::after {
    content: '▼';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: transform 0.3s;
}

.accordion-header.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 30px;
    background: white;
}

/* ===== PROCEDURE CARD ===== */
.procedure-card {
    margin-bottom: 40px;
}

.procedure-card:last-child {
    margin-bottom: 0;
}

.procedure-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2e7d32;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2e7d32;
}

/* ===== TABLEAU COMPLET ===== */
.douaneflow-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.douaneflow-table th {
    background: #f5f5f5;
    color: #333;
    font-weight: 600;
    padding: 14px 12px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-size: 14px;
}

.douaneflow-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.douaneflow-table tr:hover td {
    background: #fafafa;
}

/* Listes dans les cellules */
.admin-list,
.docs-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-list li,
.docs-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.admin-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #2e7d32;
    font-weight: bold;
    font-size: 16px;
}

.docs-list li::before {
    content: '📄';
    position: absolute;
    left: 0;
    font-size: 14px;
}

.admin-list a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
}

.admin-list a:hover {
    text-decoration: underline;
}

.download-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 11px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.montant {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.empty {
    color: #999;
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .douaneflow-table {
        display: block;
        overflow-x: auto;
    }
    
    .douaneflow-table th,
    .douaneflow-table td {
        min-width: 180px;
    }
    
    .douaneflow-table th:first-child,
    .douaneflow-table td:first-child {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
    }
    
    .search-wrapper {
        width: 100%;
    }
    
    .produit-header h2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .accordion-content {
        padding: 20px;
    }
    
    .procedure-card h3 {
        font-size: 18px;
    }
}

/* ===== PRINT ===== */
@media print {
    .search-filters,
    .autocomplete,
    .accordion-header::after {
        display: none;
    }
    
    .accordion-content {
        display: block !important;
    }
    
    .douaneflow-table {
        border: 1px solid #000;
    }
    
    .douaneflow-table th {
        background: #ddd;
    }
}