/* =============================================
   DEPO YÖNETİM SİSTEMİ - ANA STIL DOSYASI
   Modern Dark Theme with Glass Effects
   ============================================= */

:root {
    /* Renk Paleti */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Dark Theme Renkler */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-sidebar: #0f172a;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Glass Effect */
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(148, 163, 184, 0.1);
    
    /* Sidebar */
    --sidebar-width: 260px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* =============================================
   Global Styles
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav {
    padding: 0 0.75rem;
}

.nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-glow);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================
   Main Content
   ============================================= */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-bar {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 100;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-wrapper {
    padding: 1.5rem;
}

/* =============================================
   Cards
   ============================================= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.stat-card .stat-icon.success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
}

.stat-card .stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
}

.stat-card .stat-icon.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* =============================================
   Tables
   ============================================= */

.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
}

/* =============================================
   Forms
   ============================================= */

.form-control,
.form-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    border: none;
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* =============================================
   Badges
   ============================================= */

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* =============================================
   Alerts
   ============================================= */

.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* =============================================
   Modals
   ============================================= */

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
}

.btn-close {
    filter: invert(1);
}

/* =============================================
   Login Page
   ============================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: block;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.login-logo p {
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

/* =============================================
   Page Actions
   ============================================= */

.page-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 1rem;
    }
    
    .top-bar {
        padding: 0.75rem 1rem;
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* =============================================
   Animations
   ============================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Stock update indicator */
.stock-updating {
    position: relative;
}

.stock-updating::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1s infinite;
}
