/* =====================================================
   ANA STİLLER
   ===================================================== */

:root {
    /* İKEV Kurumsal Renkler */
    --primary: #1a7f37;
    --primary-dark: #116329;
    --primary-light: #4ade80;
    --primary-gradient: linear-gradient(135deg, #1a7f37 0%, #22c55e 100%);
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --gold: #d4a50a;
    --gold-light: #fef3c7;
    
    /* Nötr */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    
    /* Gölgeler */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Geçişler */
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
}

/* =====================================================
   UYGULAMA LAYOUT
   ===================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    border-right: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text .main-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-text .sub-title {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-500);
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .logo img {
    width: 36px;
    height: 36px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--primary);
    background: var(--gray-100);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, rgba(26, 127, 55, 0.05) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(26, 127, 55, 0.3);
}

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

.sidebar.collapsed .user-details {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.user-role {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    background: rgba(26, 127, 55, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.25rem;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(26, 127, 55, 0.08);
}

.nav-item.active {
    color: var(--white);
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(26, 127, 55, 0.3);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.sidebar-footer .nav-item {
    color: var(--danger);
}

.sidebar-footer .nav-item:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
}

.week-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(26, 127, 55, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: var(--primary-dark);
    border-radius: var(--radius);
    font-weight: 500;
    border: 1px solid rgba(26, 127, 55, 0.2);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
}

/* =====================================================
   KARTLAR
   ===================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(26, 127, 55, 0.15) 0%, rgba(34, 197, 94, 0.15) 100%);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* =====================================================
   TABLOLAR
   ===================================================== */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
}

tr:hover {
    background: var(--gray-50);
}

/* =====================================================
   FORM ELEMENTLERİ
   ===================================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* =====================================================
   BUTONLAR
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(26, 127, 55, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #116329 0%, #1a7f37 100%);
    box-shadow: 0 4px 12px rgba(26, 127, 55, 0.35);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

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

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   GİRİŞ KARTLARI (ENTRY CARDS)
   ===================================================== */

.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.entry-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.entry-card:hover {
    box-shadow: var(--shadow-md);
}

.entry-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.entry-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.entry-card-title {
    font-weight: 600;
    color: var(--gray-800);
}

.entry-card-body {
    padding: 1.25rem;
}

.entry-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.input-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-item label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.input-item.correct label {
    color: var(--success);
}

.input-item.wrong label {
    color: var(--danger);
}

.input-item.empty label {
    color: var(--gray-500);
}

.input-item input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

.input-item.correct input {
    border-color: var(--success);
    background: var(--success-light);
}

.input-item.wrong input {
    border-color: var(--danger);
    background: var(--danger-light);
}

.entry-card-footer {
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-display {
    font-weight: 600;
    color: var(--gray-700);
}

/* =====================================================
   PROGRESS (İLERLEME)
   ===================================================== */

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

.progress-fill.primary {
    background: var(--primary-gradient);
}

/* =====================================================
   BADGES
   ===================================================== */

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

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* =====================================================
   MODAL
   ===================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* =====================================================
   TOAST BİLDİRİMLERİ
   ===================================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: var(--primary);
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-loader.show {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* =====================================================
   WEEK SELECTOR
   ===================================================== */

.week-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.week-nav-btn {
    background: var(--white);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.week-nav-btn:hover {
    background: var(--gray-100);
}

.week-display {
    font-weight: 600;
    color: var(--gray-800);
}

/* =====================================================
   DAY TABS
   ===================================================== */

.day-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.day-tab {
    padding: 0.75rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.day-tab:hover {
    background: var(--gray-100);
}

.day-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.day-tab.completed {
    border-color: var(--success);
}

.day-tab.completed::after {
    content: '✓';
    margin-left: 0.5rem;
    color: var(--success);
}

.day-tab.active.completed::after {
    color: var(--white);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .logo span,
    .sidebar .user-details,
    .sidebar .nav-item span {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open .logo span,
    .sidebar.open .user-details,
    .sidebar.open .nav-item span {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .top-header {
        padding: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .entry-grid {
        grid-template-columns: 1fr;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--gray-500);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
