/* ═══════════════════════════════════════════
   OSB Fleet - Frontend Stilleri
   Kütahya OSB - Profesyonel Tasarım
   WordPress tema uyumlu (override korumalı)
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.ap-fleet-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: #1a1a2e !important;
    line-height: 1.6;
    overflow: hidden;
    z-index: 0;
}

/* ── Animasyonlu arka plan gradient ── */
.ap-bg-anim {
    position: absolute;
    inset: -10%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(13,71,161,.10), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(30,136,229,.10), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(187,222,251,.20), transparent 50%);
    background-size: 200% 200%;
    animation: ap-bg-shift 18s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes ap-bg-shift {
    0%   { background-position: 0% 0%, 100% 0%, 50% 100%; }
    50%  { background-position: 30% 40%, 70% 60%, 60% 50%; }
    100% { background-position: 100% 100%, 0% 100%, 40% 0%; }
}

/* ── Giriş animasyonları ── */
@keyframes ap-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ap-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ap-zoom-in {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}

.ap-fleet-header,
.ap-stats-row,
.ap-dept-item {
    animation: ap-fade-up .7s cubic-bezier(.22,.9,.36,1) both;
}
.ap-fleet-header { animation-delay: 0s; }
.ap-stats-row   { animation-delay: .15s; }

/* Logo */
.ap-fleet-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: ap-zoom-in .8s cubic-bezier(.22,.9,.36,1) both;
}
.ap-fleet-logo img {
    max-width: 200px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(13,71,161,.18));
    transition: transform .35s ease;
}
.ap-fleet-logo img:hover {
    transform: scale(1.05);
}
.ap-fleet-container * {
    box-sizing: border-box;
}

/* ── Header ── */
.ap-fleet-header {
    text-align: center;
    margin-bottom: 40px;
}
.ap-fleet-title {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #0d47a1, #1565c0, #1e88e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none !important;
    padding: 0 !important;
}
.ap-fleet-subtitle {
    font-size: 1rem !important;
    color: #64748b !important;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Stats ── */
.ap-stats-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.ap-stat-card {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 20px 36px !important;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.06) !important;
    border: 1px solid #e2e8f0 !important;
    transition: transform .2s ease;
    min-width: 150px;
}
.ap-stat-card:hover {
    transform: translateY(-3px);
}
.ap-stat-num {
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #0d47a1 !important;
    line-height: 1.2;
}
.ap-stat-label {
    font-size: .85rem !important;
    color: #64748b !important;
    margin-top: 4px;
    font-weight: 500 !important;
}

/* ── Accordion ── */
.ap-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Department Button ── */
.ap-dept-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 18px 24px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    transition: all .25s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 1rem !important;
    color: #1a1a2e !important;
    text-align: left !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}
.ap-dept-btn:hover,
.ap-dept-btn:focus {
    background: #f0f7ff !important;
    color: #0d47a1 !important;
    border-color: #93c5fd !important;
    box-shadow: 0 4px 20px rgba(13,71,161,.12) !important;
    transform: translateY(-2px);
    text-decoration: none !important;
    outline: none !important;
}
.ap-dept-btn:active {
    transform: translateY(0);
}
.ap-dept-btn.active {
    background: linear-gradient(135deg, #0d47a1, #1565c0) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 6px 24px rgba(13,71,161,.25) !important;
    border-radius: 14px 14px 0 0 !important;
}
.ap-dept-btn.active:hover {
    background: linear-gradient(135deg, #0d47a1, #1565c0) !important;
    color: #fff !important;
}

/* ── Icon ── */
.ap-dept-icon {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    color: #0d47a1 !important;
    flex-shrink: 0;
    transition: all .25s;
}
.ap-dept-btn:hover .ap-dept-icon {
    background: linear-gradient(135deg, #bbdefb, #90caf9) !important;
    color: #0d47a1 !important;
}
.ap-dept-btn.active .ap-dept-icon {
    background: rgba(255,255,255,.2) !important;
    color: #fff !important;
}

/* ── Info ── */
.ap-dept-info {
    flex: 1;
    min-width: 0;
}
.ap-dept-info h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 0 2px !important;
    padding: 0 !important;
    color: inherit !important;
    border: none !important;
    line-height: 1.4 !important;
}
.ap-dept-info span {
    font-size: .82rem !important;
    color: #94a3b8 !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ap-dept-btn:hover .ap-dept-info h3 {
    color: #0d47a1 !important;
}
.ap-dept-btn.active .ap-dept-info h3 {
    color: #fff !important;
}
.ap-dept-btn.active .ap-dept-info span {
    color: rgba(255,255,255,.7) !important;
}

/* ── Badge ── */
.ap-dept-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 50%;
}
.ap-dept-btn.active .ap-dept-badges .ap-dept-badge {
    background: rgba(255,255,255,.2) !important;
    color: #fff !important;
}
.ap-dept-badge {
    background: #e3f2fd !important;
    color: #0d47a1 !important;
    font-weight: 700 !important;
    font-size: .85rem !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .25s;
    border: none !important;
    text-decoration: none !important;
}
.ap-dept-btn:hover .ap-dept-badge {
    background: #bbdefb !important;
    color: #0d47a1 !important;
}
.ap-dept-btn.active .ap-dept-badge {
    background: rgba(255,255,255,.2) !important;
    color: #fff !important;
}

/* ── Chevron ── */
.ap-dept-chevron {
    font-size: 1rem !important;
    transition: transform .3s ease;
    color: #94a3b8 !important;
    flex-shrink: 0;
}
.ap-dept-btn:hover .ap-dept-chevron {
    color: #0d47a1 !important;
}
.ap-dept-btn.active .ap-dept-chevron {
    transform: rotate(180deg);
    color: #fff !important;
}

/* ── Detail Panel ── */
.ap-dept-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height .5s cubic-bezier(0.4, 0, 0.2, 1), opacity .3s ease;
    opacity: 0;
}
.ap-dept-detail.open {
    opacity: 1;
}

.ap-detail-inner {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 3px solid #1565c0 !important;
    border-radius: 0 0 16px 16px !important;
    padding: 28px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.05) !important;
}
.ap-detail-inner h4 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #0d47a1 !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    border: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Vehicle Table ── */
.ap-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.ap-vehicle-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: .9rem !important;
    background: #fff !important;
}
.ap-vehicle-table thead {
    background: linear-gradient(135deg, #f0f7ff, #e8f0fe) !important;
}
.ap-vehicle-table th {
    padding: 14px 16px !important;
    text-align: left !important;
    font-weight: 700 !important;
    color: #0d47a1 !important;
    font-size: .82rem !important;
    text-transform: none !important;
    letter-spacing: .5px !important;
    border-bottom: 2px solid #dbeafe !important;
    white-space: nowrap;
    background: transparent !important;
}
.ap-vehicle-table td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    color: #334155 !important;
    background: transparent !important;
}
.ap-vehicle-table tbody tr {
    transition: background .2s;
    background: #fff !important;
}
.ap-vehicle-table tbody tr:hover {
    background: #f8fafc !important;
}
.ap-vehicle-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Table columns */
.ap-th-foto { width: 90px; }
.ap-th-count { width: 70px; text-align: center !important; }

.ap-vehicle-img {
    width: 80px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.ap-vehicle-img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.ap-vehicle-placeholder {
    width: 80px;
    height: 55px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8 !important;
    font-size: 1.2rem;
}

.ap-td-name strong {
    display: block;
    color: #1e293b !important;
    font-size: .92rem !important;
}
.ap-type-tag {
    display: inline-block;
    background: #f0f7ff !important;
    color: #2563eb !important;
    font-size: .72rem !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    margin-top: 4px;
    font-weight: 600 !important;
    border: none !important;
    text-decoration: none !important;
}
.ap-td-plate {
    font-family: 'Courier New', monospace !important;
    font-weight: 600 !important;
    color: #475569 !important;
    font-size: .88rem !important;
}
.ap-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    min-width: 32px;
    height: 28px;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: .85rem !important;
    border: none !important;
}
.ap-td-count {
    text-align: center !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ap-fleet-title {
        font-size: 1.5rem !important;
    }
    .ap-dept-btn {
        padding: 14px 16px !important;
        gap: 12px !important;
    }
    .ap-dept-icon {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        font-size: 1rem !important;
    }
    .ap-dept-info span {
        display: none;
    }
    .ap-detail-inner {
        padding: 16px 12px !important;
    }
    .ap-vehicle-table th,
    .ap-vehicle-table td {
        padding: 10px 8px !important;
        font-size: .82rem !important;
    }
    .ap-vehicle-img,
    .ap-vehicle-placeholder {
        width: 60px;
        height: 42px;
    }
    .ap-th-foto { width: 70px; }
}

@media (max-width: 480px) {
    .ap-fleet-container {
        padding: 20px 12px;
    }
    .ap-dept-badge {
        font-size: .75rem !important;
        padding: 4px 10px !important;
    }
    .ap-stat-card {
        min-width: 110px;
        padding: 16px 20px !important;
    }
}

/* ── Foto Popup (Lightbox) ── */
.ap-vehicle-img {
    cursor: zoom-in;
}
.ap-photo-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity .2s ease;
    padding: 20px;
}
.ap-photo-modal.open {
    opacity: 1;
}
.ap-photo-modal-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ap-photo-modal-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    display: block;
}
.ap-photo-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #0d47a1;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ap-photo-modal-close:hover {
    background: #f1f5f9;
}
body.ap-modal-open {
    overflow: hidden;
}

/* ── Birim butonu hover parlama ── */
.ap-dept-btn {
    position: relative;
    overflow: hidden;
}
.ap-dept-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
    transform: skewX(-20deg);
    pointer-events: none;
    transition: left .7s ease;
    z-index: 1;
}
.ap-dept-btn:hover::before {
    left: 130%;
}
.ap-dept-btn.active::before {
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
}
.ap-dept-btn > * {
    position: relative;
    z-index: 2;
}

/* ── Tablo satır stagger animasyonu ── */
@keyframes ap-row-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.ap-dept-detail.open .ap-vehicle-table tbody tr {
    animation: ap-row-in .45s ease both;
}
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(1)  { animation-delay: .05s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(2)  { animation-delay: .12s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(3)  { animation-delay: .19s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(4)  { animation-delay: .26s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(5)  { animation-delay: .33s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(6)  { animation-delay: .40s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(7)  { animation-delay: .47s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(8)  { animation-delay: .54s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(9)  { animation-delay: .61s; }
.ap-dept-detail.open .ap-vehicle-table tbody tr:nth-child(n+10) { animation-delay: .68s; }

/* Hareketli efektleri azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
    .ap-bg-anim,
    .ap-fleet-header,
    .ap-stats-row,
    .ap-dept-item,
    .ap-fleet-logo,
    .ap-dept-detail.open .ap-vehicle-table tbody tr {
        animation: none !important;
    }
    .ap-dept-btn::before { display: none; }
}
