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

/* --- DIZAYN SISTEMI (CSS DEYISENLERI) --- */
:root {
    --bg-main: #080c14;
    --bg-surface: rgba(17, 25, 40, 0.65);
    --bg-surface-hover: rgba(26, 38, 60, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.18);
    
    --primary: #6366f1;
    --primary-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981;
    --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --success-glow: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-grad: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --warning-glow: rgba(245, 158, 11, 0.3);

    --danger: #ef4444;
    --danger-grad: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & GLOBAL STYLE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(17, 24, 39, 0.5) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* --- CONTAINER & LAYOUT --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 40px 0;
    animation: fadeIn 0.4s ease-out;
}

/* --- NAVIGASIYA BAR (HEADER) --- */
.navbar {
    background: rgba(8, 12, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-brand span {
    color: var(--text-main);
    -webkit-text-fill-color: initial;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-item a:hover,
.nav-item.active a {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.user-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: #a5b4fc;
}

.user-badge.admin {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.logout-btn {
    padding: 8px;
    border-radius: var(--radius-sm);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #ef4444;
}

/* --- GLASS CARD --- */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- GIRIŞ PANELİ (PIN LOGIN SCREEN) --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 40px 30px;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* PIN Indicator Dots */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color-hover);
    transition: var(--transition-fast);
}

.pin-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary);
    transform: scale(1.2);
}

/* Pin Keypad Grid */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 280px;
    margin: 0 auto 20px auto;
}

.pin-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    outline: none;
    -webkit-user-select: none;
    user-select: none;
}

.pin-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.pin-btn:active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: scale(0.95);
}

.pin-btn.action-btn {
    font-size: 1rem;
    color: var(--text-muted);
}

.pin-btn.action-btn:hover {
    color: var(--text-main);
}

.pin-btn.danger-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
}

.alert-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

/* --- DÜYMƏLƏR (BUTTONS) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-grad);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-grad);
    color: white;
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: var(--danger-grad);
    color: white;
    box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- FORMA DİZAYNI (FORM STYLES) --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px var(--primary-glow);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- SİFARİŞ KARTLARI (ORDERS GRID) --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.order-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.order-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.6);
}

/* Card glass glow depending on status */
.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.order-card.status-yeni::before {
    background: var(--primary);
}

.order-card.status-goturuldu::before {
    background: var(--warning);
}

/* Card Header */
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-id {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Custom Badges */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-yeni {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-goturuldu {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-tamamlandı {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Route Timeline Indicator */
.route-timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
    margin: 8px 0;
}

.route-timeline::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-style: dashed;
}

.route-point {
    position: relative;
    margin-bottom: 12px;
}

.route-point:last-child {
    margin-bottom: 0;
}

.route-point::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

.route-point.from::before {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.route-point.to::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.route-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.route-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Order Details Grid */
.order-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 500;
}

.order-note {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary);
    color: var(--text-muted);
}

.order-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.order-actors {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
}

.actor-name {
    color: var(--text-main);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- TABLISALAR (TABLES FOR ARCHIVE) --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--bg-surface);
    font-size: 0.9rem;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- ADMIN PANEL / USER LIST --- */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary);
}

.user-pin {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--warning);
}

/* --- ANIMASIYALAR --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); }
}

/* Footer Section */
.footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    background: rgba(8, 12, 20, 0.5);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-profile {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
}
