/*
 * MyFood Panel - Ana Stil Dosyası
 * Tailwind CSS ile birlikte kullanılır
 * 
 * Bu dosya tüm özel stilleri içerir.
 * Tailwind utility class'ları HTML'de kullanılmaya devam eder.
 */

/* ========================================
   1. GENEL AYARLAR
   ======================================== */

:root {
    /* Renkler */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    /* Sidebar */
    --sidebar-bg: #111827;
    --sidebar-width: 256px;
    --sidebar-width-mobile: 288px;
    
    /* Geçişler */
    --transition-fast: 150ms;
    --transition-normal: 300ms;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* iOS input zoom fix */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px !important;
    }
}

/* ========================================
   2. SIDEBAR & NAVİGASYON
   ======================================== */

/* Sidebar Link */
.nav-link {
    transition: all var(--transition-fast) ease-in-out;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: var(--info);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal) ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar Slide */
.sidebar-mobile {
    transform: translateX(-100%);
    transition: transform var(--transition-normal) ease;
}

.sidebar-mobile.active {
    transform: translateX(0);
}

/* ========================================
   3. TOUCH & MOBİL
   ======================================== */

/* Touch-friendly minimum boyut */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* Mobil için daha büyük tıklama alanları */
@media (max-width: 768px) {
    .btn, 
    button, 
    a.touch-target,
    .touch-target {
        min-height: 44px;
    }
}

/* ========================================
   4. FORM ELEMANLARI
   ======================================== */

/* Input focus stilleri */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox ve Radio büyütme (mobil) */
@media (max-width: 768px) {
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

/* File input gizleme */
input[type="file"].hidden {
    display: none;
}

/* ========================================
   5. TABLO STİLLERİ
   ======================================== */

/* Responsive tablo container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablo hover efekti */
.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* ========================================
   6. KART STİLLERİ
   ======================================== */

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-hover {
    transition: box-shadow var(--transition-fast) ease;
}

.card-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   7. BADGE & ETIKETLER
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #374151;
}

/* ========================================
   8. BUTON STİLLERİ
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all var(--transition-fast) ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Buton boyutları */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Full width buton (mobil) */
@media (max-width: 640px) {
    .btn-mobile-full {
        width: 100%;
    }
}

/* ========================================
   9. ALERT / BİLDİRİM
   ======================================== */

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ========================================
   10. AVATAR
   ======================================== */

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    overflow: hidden;
    background-color: #e5e7eb;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   11. LOADING / SPINNER
   ======================================== */

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========================================
   12. SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* ========================================
   13. UTILITY CLASSES
   ======================================== */

/* Metin kırpma */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gölgeler */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Safe area (notch desteği) */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ========================================
   14. PRINT STİLLERİ
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .sidebar-mobile,
    .sidebar-overlay,
    aside {
        display: none !important;
    }
    
    main {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ========================================
   15. ANİMASYONLAR
   ======================================== */

.fade-in {
    animation: fadeIn var(--transition-normal) ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp var(--transition-normal) ease;
}

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