/* Custom CSS for Kassenbuch Application */

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

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-color);
}

/* Apply Nunito to all elements */
* {
    font-family: var(--font-family);
}

/* Smooth transitions */
* {
    transition: var(--transition);
}

/* Navbar customization */
.navbar {
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Card customization */
.card {
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    border: none;
    overflow: hidden;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Button customization */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-group .btn {
    transform: none;
}

/* Table customization */
.table {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    font-weight: 600;
    background-color: #495057 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 0.75rem;
}

.table thead tr {
    background-color: #495057 !important;
}

.table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Form customization */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529 !important;
    font-size: 0.95rem;
}

.input-group-text {
    background-color: var(--light-color);
    border: 1px solid #dee2e6;
}

/* Form validation feedback */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

/* Dashboard stats cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category badge styling */
.category-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Expense amount styling */
.expense-amount {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--dark-color);
}

/* Chart container */
.chart-container {
    position: relative;
    height: 350px;
    padding: 1rem;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* Scroll to top button */
#scrollToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--box-shadow-lg);
    cursor: pointer;
    z-index: 1000;
    font-size: 1.5rem;
}

#scrollToTop:hover {
    background-color: #0b5ed7;
    transform: translateY(-4px);
}

/* Toast notifications */
.toast {
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
}

/* Progress bars */
.progress {
    height: 0.75rem;
    border-radius: 2rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 2rem;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.alert i {
    margin-right: 0.5rem;
}

/* Modal enhancements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 2px solid #e9ecef;
}

.modal-footer {
    border-top: 2px solid #e9ecef;
}

/* Dropdown menu */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    border: none;
}

.dropdown-item {
    padding: 0.625rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
}

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

.page-link {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    margin: 0 0.125rem;
}

.page-link:hover {
    background-color: var(--light-color);
}

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

/* Responsive utilities */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    #scrollToTop {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
}

@media (max-width: 576px) {
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    #scrollToTop,
    .toast-container {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        background-color: white;
    }
}

/* Accessibility improvements */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #212529;
        --dark-color: #f8f9fa;
    }
    
    /* Dark mode styles will be implemented in phase 8 */
}
