/* Muslim Prayer Times Styles */

.mpt-daily {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 420px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d1a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.mpt-city {
    text-align: center;
    font-size: 1.4em;
    margin: 0 0 5px 0;
    color: #c8e6c9;
}

.mpt-date {
    text-align: center;
    font-size: 0.9em;
    margin: 0 0 15px 0;
    color: #a5d6a7;
}

.mpt-note {
    text-align: center;
    font-size: 0.8em;
    color: #ffcc80;
    margin: 0 0 10px 0;
    font-style: italic;
}

.mpt-times {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mpt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: background 0.3s;
}

.mpt-row:hover {
    background: rgba(255,255,255,0.2);
}

.mpt-row.mpt-current {
    background: rgba(255,183,77,0.2);
    border-left: 3px solid #ffb74d;
}

.mpt-row.mpt-current .mpt-name {
    color: #ffe0b2;
}

.mpt-name {
    font-weight: 600;
    font-size: 1em;
}

.mpt-time {
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fff9c4;
}

/* Horizontal layout */
.mpt-horizontal .mpt-times {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.mpt-horizontal .mpt-row {
    flex: 1;
    min-width: 120px;
    flex-direction: column;
    text-align: center;
}

/* Monthly table */
.mpt-monthly {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    margin: 20px 0;
}

.mpt-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    background: #fff;
}

.mpt-table thead {
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d1a 100%);
    color: #fff;
}

.mpt-table th {
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

.mpt-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.mpt-table tbody tr:hover {
    background: #f1f8e9;
}

.mpt-table tbody tr.mpt-today {
    background: #c8e6c9;
    font-weight: 700;
}

.mpt-table tbody tr.mpt-today td:first-child {
    border-left: 3px solid #2e7d32;
}

.mpt-error-cell {
    color: #c62828;
    font-style: italic;
}

/* City selector */
.mpt-selector {
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.mpt-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #1a5f2a;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* Worldwide city search */
.mpt-search-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
}

.mpt-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.mpt-search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #1a5f2a;
    border-radius: 8px;
    background: #fff;
}

.mpt-search-btn {
    padding: 12px 24px;
    font-size: 1em;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d1a 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.mpt-search-btn:hover {
    opacity: 0.9;
}

.mpt-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mpt-search-results {
    margin-bottom: 15px;
}

.mpt-search-result-item {
    padding: 12px 15px;
    background: #f1f8e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mpt-search-result-item:hover {
    background: #c8e6c9;
    transform: translateX(5px);
}

.mpt-search-result-item .mpt-result-name {
    font-weight: 600;
    color: #1a5f2a;
}

.mpt-search-result-item .mpt-result-coords {
    font-size: 0.85em;
    color: #666;
}

.mpt-search-loading {
    text-align: center;
    color: #1a5f2a;
    padding: 15px;
}

.mpt-search-error {
    padding: 12px;
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    text-align: center;
}

/* Error message */
.mpt-error {
    padding: 15px;
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* ================================================================
   Barre « Temps des prières » en haut du site
   (sélecteurs avec #mpt-topbar : assez précis pour résister aux styles du thème)
   ================================================================ */
#mpt-topbar {
    position: relative;
    z-index: 99990;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #0f5a2d;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

#mpt-topbar > summary.mpt-topbar-toggle {
    display: block;
    list-style: none;
    margin: 0;
    padding: 10px 16px;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    background: transparent;
    user-select: none;
}

#mpt-topbar > summary.mpt-topbar-toggle::-webkit-details-marker { display: none; }
#mpt-topbar > summary.mpt-topbar-toggle::marker { content: ''; }

/* Petite flèche à droite du titre, qui se retourne quand le menu est ouvert */
#mpt-topbar > summary.mpt-topbar-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s;
}

#mpt-topbar[open] > summary.mpt-topbar-toggle::after { transform: rotate(180deg); }
#mpt-topbar > summary.mpt-topbar-toggle:hover { background: rgba(255,255,255,0.08); }
#mpt-topbar > summary.mpt-topbar-toggle:focus-visible { outline: 2px solid #fff9c4; outline-offset: -2px; }

/* Le menu se déroule PAR-DESSUS la page (il ne la décale pas) */
#mpt-topbar .mpt-topbar-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 16px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    box-sizing: border-box;
}

#mpt-topbar .mpt-topbar-inner {
    max-width: 460px;
    margin: 0 auto;
}

#mpt-topbar .mpt-topbar-select {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 1em;
    color: #222;
    background: #fff;
    border: 2px solid #0f5a2d;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
}

/* La carte du jour s'intègre dans le menu : pas de marge ni d'ombre en plus */
#mpt-topbar .mpt-daily {
    max-width: 100%;
    margin: 0;
    padding: 16px;
    box-shadow: none;
}

#mpt-topbar .mpt-topbar-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
    color: #0f5a2d;
    text-decoration: underline;
}

@media print {
    #mpt-topbar { display: none; }
}

/* Admin styles */
.mpt-admin-section {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mpt-method ul {
    list-style: disc;
    margin-left: 20px;
}

.mpt-shortcodes code {
    display: block;
    background: #f5f5f5;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border-left: 4px solid #1a5f2a;
}

#mpt-test-result {
    margin-top: 20px;
    padding: 15px;
    background: #f1f8e9;
    border-radius: 8px;
    display: none;
}

#mpt-test-result.active {
    display: block;
}
