/* ============================================
   Kartlı Satış ve Ödeme Yönetimi Sistemi - Veli Paneli CSS
   Modern, Responsive Design
   ============================================ */

:root {
    /* Ana Renkler */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    /* Nötr Renkler */
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--white);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

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

.sidebar-user {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 48px;
    min-width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.menu-item {
    margin: 0.25rem 0.75rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--gray-300);
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.menu-item.active > a {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.menu-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.top-navbar {
    background: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    display: none;
}

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

.navbar-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.navbar-actions {
    margin-left: auto;
}

.navbar-actions .btn-link {
    color: var(--gray-600);
    font-size: 1.5rem;
}

.page-content {
    padding: 1.5rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

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

.stat-card .stat-icon.primary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-card .stat-icon.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

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

/* ============================================
   Tables
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

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

/* ============================================
   Forms
   ============================================ */
.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

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

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.input-group-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    color: var(--gray-500);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ============================================
   Badges
   ============================================ */
.badge {
    padding: 0.5em 0.75em;
    border-radius: var(--radius);
    font-weight: 500;
}

.badge-harcama {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-yukleme {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-iade {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* ============================================
   Login Page
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

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

.login-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 0.5rem;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: none;
    border-radius: var(--radius);
    color: var(--gray-600);
    padding: 0.5rem 0.875rem;
}

.page-item.active .page-link {
    background: var(--primary-color);
}

.page-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Price Display */
.price {
    font-weight: 600;
    font-family: 'Inter', monospace;
}

.price-positive {
    color: var(--success-color);
}

.price-negative {
    color: var(--danger-color);
}

/* ============================================
   Footer - Professional Minimal Design
   ============================================ */
.app-footer {
    background: transparent;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer-text {
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-brand:hover {
    opacity: 1;
}

.footer-logo {
    height: 16px !important;
    width: auto !important;
    max-height: 16px !important;
    display: block;
}

/* Footer for Login Page */
.app-footer-login {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    margin-top: 0;
}

.app-footer-login .footer-text {
    color: var(--gray-500);
}

.app-footer-login .footer-brand {
    opacity: 0.8;
}

/* Responsive Footer */
@media (max-width: 575.98px) {
    .app-footer {
        padding: 0.75rem 0;
        margin-top: 1rem;
    }

    .footer-logo {
        height: 14px !important;
        max-height: 14px !important;
    }

    .footer-text {
        font-size: 10px;
    }
}

/* ============================================
   Sidebar Submenu
   ============================================ */
.menu-item.has-submenu > a {
    position: relative;
}

.menu-item.has-submenu > a .submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.menu-item.has-submenu > a:not(.collapsed) .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu li {
    margin: 0.125rem 0;
}

.submenu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    color: var(--gray-400);
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.submenu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.submenu li.active a {
    background: rgba(79, 70, 229, 0.2);
    color: var(--white);
}

.submenu li a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* ============================================
   Student Photo Styles
   ============================================ */
.student-photo-link {
    display: block;
    text-decoration: none;
}

.student-photo-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transition: var(--transition);
}

.student-photo-container:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.student-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.student-photo-container:hover .photo-edit-overlay {
    opacity: 1;
}

.photo-edit-overlay i {
    font-size: 1.5rem;
    color: white;
}

.photo-add-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--success-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.photo-add-badge i {
    font-size: 0.875rem !important;
    color: white;
}

/* Sidebar User Photo */
.sidebar-user-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.sidebar-user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navbar User Photo */
.navbar-user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.navbar-user-photo:hover {
    border-color: var(--primary-color);
}

.navbar-actions .btn-link {
    padding: 0.25rem;
}

.navbar-actions .dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Sidebar Header Logo (School Logo) */
.sidebar-header-logo {
    max-width: 200px;
    height: auto;
    padding: 8px;
}

/* Sidebar Bottom Logo (Dinosoft) */
.sidebar-bottom-logo {
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.sidebar-bottom-logo span {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.sidebar-bottom-logo img {
    height: 28px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-bottom-logo img:hover {
    opacity: 1;
}
