/*
Theme Name: Yakuza Dealers
Theme URI: https://kingpin.yakuzaev.com/
Author: Yakuza E-Vehicles
Author URI: https://yakuzaev.com/
Description: Custom dealer listing theme for Yakuza E-Vehicles dealer management portal.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yakuza-dealers
*/

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }

/* ══════════════════════════════════════════════════
   SITE HEADER
══════════════════════════════════════════════════ */
.site-header { text-align: center; padding: 14px 16px; background: transparent; }
.site-logo img { max-height: 70px; width: auto; }

/* ══════════════════════════════════════════════════
   INNER PAGE CONTAINER (directory / form pages)
══════════════════════════════════════════════════ */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    background: #fff;
    min-height: 100vh;
}
@media (min-width: 640px) {
    .container {
        margin: 20px auto;
        border-radius: 14px;
        min-height: auto;
        box-shadow: 0 4px 24px rgba(0,0,0,.10);
        padding: 28px 32px 56px;
    }
}
.dir-container { max-width: 1020px; }

/* ══════════════════════════════════════════════════
   DIRECTORY PAGE HEADER
══════════════════════════════════════════════════ */
.dir-header { margin-bottom: 20px; }
.dir-header h1 { font-size: 1.3rem; color: #1a2e44; font-weight: 800; margin: 6px 0 0; }

.pg-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: #2980b9; text-decoration: none;
    font-size: .85rem; font-weight: 600; margin-bottom: 10px;
}
.pg-back:hover { color: #1a5e8a; }

/* ══════════════════════════════════════════════════
   DIRECTORY TOOLBAR (search + add button)
══════════════════════════════════════════════════ */
.dir-toolbar {
    display: flex; flex-wrap: wrap;
    align-items: flex-end; gap: 12px; margin-bottom: 20px;
}
.search-form { flex: 1; min-width: 0; }
.search-form__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; flex: 1 1 140px; min-width: 0; }
.form-group--btn { flex: 0 0 auto; }
.form-group label { font-size: .8rem; font-weight: 700; color: #555; margin-bottom: 5px; }

select, input[type="text"], input[type="tel"], input[type="password"], textarea {
    width: 100%; padding: 10px 12px; font-size: .93rem; font-family: inherit;
    border: 1.5px solid #d8dde8; border-radius: 9px; background: #fff; color: #333;
    transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
select:focus, input:focus, textarea:focus {
    border-color: #2980b9; box-shadow: 0 0 0 3px rgba(41,128,185,.12); outline: none;
}

.btn-search {
    background: #2980b9; color: #fff; border: none;
    padding: 10px 20px; border-radius: 8px; font-weight: 700;
    cursor: pointer; white-space: nowrap; font-size: .9rem; transition: background .2s;
}
.btn-search:hover { background: #1a6494; }

.btn-add-dealer {
    background: linear-gradient(135deg, #1e8449, #27ae60);
    color: #fff; border: none; padding: 10px 18px;
    border-radius: 8px; font-weight: 700; cursor: pointer;
    white-space: nowrap; font-size: .88rem;
    box-shadow: 0 3px 10px rgba(39,174,96,.35);
    transition: transform .2s, box-shadow .2s;
}
.btn-add-dealer:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(39,174,96,.45); }

/* ══════════════════════════════════════════════════
   INLINE ADD FORM (manager on directory page)
══════════════════════════════════════════════════ */
.inline-form-wrap { margin-bottom: 22px; }
.inline-form {
    background: #f0f7ff; border: 2px solid #aed6f1;
    border-radius: 14px; padding: 22px;
    animation: slideDown .25s ease;
}
.inline-form--other { background: #f0fff8; border-color: #a9dfbf; }
.inline-form h3 { margin: 0 0 16px; font-size: 1rem; color: #1a3a5c; }
@keyframes slideDown { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:translateY(0)} }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
@media (min-width: 480px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-group--full { grid-column: 1 / -1; }

label { display: block; font-weight: 600; margin-bottom: 5px; color: #34495e; font-size: .88rem; }
.req { color: #e74c3c; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-submit {
    background: linear-gradient(135deg, #1d6fa8, #2980b9); color: #fff;
    border: none; padding: 11px 26px; border-radius: 9px;
    font-weight: 700; cursor: pointer; font-size: .93rem;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 3px 12px rgba(41,128,185,.35);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(41,128,185,.5); }
.btn-submit--other {
    background: linear-gradient(135deg, #1e8449, #27ae60);
    box-shadow: 0 3px 12px rgba(39,174,96,.35);
}
.btn-cancel {
    background: #ecf0f1; color: #666; border: none;
    padding: 11px 20px; border-radius: 9px; cursor: pointer;
    font-size: .9rem; transition: background .2s;
}
.btn-cancel:hover { background: #d5d8dc; }

/* ══════════════════════════════════════════════════
   DEALER CARDS — YAKUZA & OTHER BRAND
══════════════════════════════════════════════════ */
.dealer-list-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.dealer-card {
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.dealer-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); }

/* Card body rows */
.dc-body { padding: 14px 18px; }

.dc-row {
    margin: 0 0 6px 0;
    font-size: .93rem;
    color: #222;
    line-height: 1.55;
}
.dc-row:last-child { margin-bottom: 0; }
.dc-row strong { font-weight: 700; color: #111; }

.dc-indent {
    padding-left: 0;
    color: #333;
    font-size: .91rem;
    margin-bottom: 2px !important;
}

.dc-phone { color: #2980b9; text-decoration: none; font-weight: 500; }
.dc-phone:hover { text-decoration: underline; }

.dc-active    { color: #1a7a3c; font-weight: 700; }
.dc-suspended { color: #c0392b; font-weight: 700; }

/* Card action buttons (manager edit/delete) */
.dealer-card-actions {
    padding: 10px 16px; border-top: 1px solid #eef0f5;
    background: #f9fafb; display: flex; gap: 8px;
}
.btn-action {
    padding: 6px 14px; border-radius: 6px; border: none;
    font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-edit         { background: #e8f4fd; color: #2980b9; }
.btn-edit:hover   { background: #cce4f7; }
.btn-delete       { background: #fdedec; color: #c0392b; }
.btn-delete:hover { background: #f9d5d3; }

.result-count {
    font-size: .85rem; color: #888; font-weight: 600;
    padding: 6px 0; border-bottom: 1px solid #eee; margin-bottom: 14px;
}

@media (max-width: 480px) {
    .dc-body { padding: 12px 14px; }
    .dc-row  { font-size: .9rem; }
}

/* ══════════════════════════════════════════════════
   MODAL (manager edit)
══════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 20px 16px; overflow-y: auto;
}
.modal-box {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 700px;
    padding: 24px 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
    animation: mIn .22s ease; margin: auto;
}
@keyframes mIn { from{opacity:0;transform:translateY(-16px)} to{opacity:1;transform:translateY(0)} }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { margin: 0; font-size: 1.05rem; color: #1a2e44; }
.modal-close {
    background: #f0f0f0; border: none; width: 32px; height: 32px;
    border-radius: 50%; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.modal-close:hover { background: #ddd; }

/* ══════════════════════════════════════════════════
   FEEDBACK BOXES
══════════════════════════════════════════════════ */
.form-success {
    background: #eafaf1; border: 1px solid #a9dfbf; color: #1e6b3a;
    padding: 12px 15px; border-radius: 9px; font-weight: 600;
    margin-bottom: 16px; animation: fadeIn .25s ease;
}
.form-error {
    background: #fdedec; border: 1px solid #f1948a; color: #c0392b;
    padding: 12px 15px; border-radius: 9px; font-weight: 600;
    margin-bottom: 16px; animation: fadeIn .25s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }

.message { text-align: center; color: #999; font-style: italic; padding: 28px 0; }

.loading-wrap {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 36px; color: #aaa; font-style: italic;
}
.spin-dark {
    width: 20px; height: 20px; flex-shrink: 0;
    border: 2px solid #e0e0e0; border-top-color: #2980b9;
    border-radius: 50%; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════ */
.container h1 { font-size: 1.3rem; color: #1a2e44; font-weight: 800; text-align: center; margin-bottom: 24px; }

.login-error-box {
    background: #fdedec; border: 1px solid #f1948a; color: #c0392b;
    padding: 12px 16px; border-radius: 9px; font-weight: 600;
    text-align: center; margin-bottom: 20px;
}
.login-button {
    display: inline-block; background: #2980b9; color: #fff;
    padding: 11px 28px; border-radius: 8px; font-weight: 700;
    text-decoration: none; font-size: .95rem; transition: background .2s; border: none; cursor: pointer; width: 100%;
}
.login-button:hover { background: #1a6494; color: #fff; }
