﻿/* Modern Renk Paleti ve Değişkenler */
:root {
    --order-bg: #f8fafc;
    --sidebar-bg: #0f172a;
    --card-bg: #ffffff;
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    /* Status Colors */
    --status-0-bg: #eef2ff;
    --status-0-text: #4338ca; /* Pending */
    --status-1-bg: #fefce8;
    --status-1-text: #a16207; /* Preparing */
    --status-2-bg: #f0fdf4;
    --status-2-text: #15803d; /* Delivered */
    --status-3-bg: #fef2f2;
    --status-3-text: #b91c1c; /* Cancelled */

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--order-bg);
    color: var(--text-main);
    font-family: 'Tajawal', sans-serif;
}

/* Layout Değişiklikleri & Responsive */
.main-content {
    margin-right: 280px; /* Sidebar Genişliği */
    transition: var(--transition);
    padding: 2rem;
}

@media (max-width: 992px) {
    .main-content {
        margin-right: 0;
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }

    .filter-wrapper .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .custom-select {
        width: 100%;
        margin-top: 10px;
    }
}

/* Profesyonel Tablo Tasarımı */
.table-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.orders-table {
    min-width: 1100px; /* Daha kolay scroll deneyimi için bir nebze daraltıldı */
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: #f1f5f9;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Responsive Table Padding (Mobil Yakınlaştırma) */
@media (max-width: 768px) {
    .custom-table th {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }

    .custom-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}

.order-row {
    transition: var(--transition);
}

    .order-row:hover {
        background-color: #f8fafc;
    }

/* Filtreleme Select Tasarımı */
.filter-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.2rem;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
}

    .custom-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

/* Status Pill Style */
.status-pill {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Status Classes (ألوان الحالات) */
.status-0 {
    background-color: var(--status-0-bg);
    color: var(--status-0-text);
}

.status-1 {
    background-color: var(--status-1-bg);
    color: var(--status-1-text);
}

.status-2 {
    background-color: var(--status-2-bg);
    color: var(--status-2-text);
}

.status-3 {
    background-color: var(--status-3-bg);
    color: var(--status-3-text);
}

/* Map Button */
.btn-map {
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

    .btn-map:hover {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

/* Scrollbar Styles */
.top-scrollbar {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    background: transparent;
    margin-bottom: 4px;
}

    .top-scrollbar::-webkit-scrollbar,
    .drag-scroll::-webkit-scrollbar {
        height: 8px;
    }

    .top-scrollbar::-webkit-scrollbar-track,
    .drag-scroll::-webkit-scrollbar-track {
        background: var(--border-color);
        border-radius: 10px;
    }

    .top-scrollbar::-webkit-scrollbar-thumb,
    .drag-scroll::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }

        .top-scrollbar::-webkit-scrollbar-thumb:hover,
        .drag-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--primary-hover);
        }

.top-scrollbar-inner {
    height: 1px;
    visibility: hidden;
}

.drag-scroll {
    cursor: grab;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .drag-scroll:active {
        cursor: grabbing;
    }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-row {
    animation: fadeIn 0.4s ease forwards;
}

/* ==============================================================
   ORDER DETAILS PAGE SPECIFIC STYLES (E-Commerce Pro Layout)
   ============================================================== */

/* Back Button */
.btn-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
    font-size: 1.2rem;
}

    .btn-back:hover {
        background-color: var(--order-bg);
        color: var(--primary);
        border-color: var(--primary);
    }

.status-badge-inline {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    vertical-align: middle;
}

/* Details Table adjustments */
 
.details-table th {
    background-color: #f8fafc !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.details-table td {
    border-bottom: 1px solid var(--border-color);
    /* Üst ve alt boşlukları (Vertical padding) daralttık.
       Yan boşlukları CSS yerine HTML üzerinden (px-1) kontrol ediyoruz. */

    padding: 0.4rem !important;
    
}

/* Order Timeline (Progress Bar) */
.order-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 10px 20px;
}

    /* Çizgi (Arka Plan) */
    .order-timeline::before {
        content: '';
        position: absolute;
        top: 25px; /* İkonun tam ortası */
        left: 10%;
        right: 10%;
        height: 3px;
        background-color: var(--border-color);
        z-index: 1;
    }

.timeline-step {
    position: relative;
    z-index: 2;
    text-align: center;
    background-color: white;
    padding: 0 10px;
    width: 30%;
}

.timeline-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 10px auto;
    border: 4px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
    transition: var(--transition);
}

.timeline-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #94a3b8;
    transition: var(--transition);
}

/* Active Step (Mavi) */
.timeline-step.active .timeline-icon {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-step.active .timeline-label {
    color: var(--primary);
}

/* Completed Step (Yeşil) */
.timeline-step.completed .timeline-icon {
    background-color: #10b981;
    color: white;
    box-shadow: 0 0 0 2px #10b981;
}

.timeline-step.completed .timeline-label {
    color: #10b981;
}

/* PRINT MEDIA (Fatura Yazdırma Ayarları) */
@media print {
    body {
        background-color: white;
    }

    .admin-sidebar,
    .top-scrollbar,
    .btn-toggle-sidebar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .col-lg-8, .col-lg-4 {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }
    /* Kağıt israfını önlemek için kartlar arası boşlukları azalt */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
}