/* ==========================================
   Agrar Simulator - Hauptstile
   ========================================== */

:root {
    /* Farben */
    --color-primary: #4a7c23;
    --color-primary-dark: #2d5016;
    --color-primary-light: #6ba332;
    --color-secondary: #8b5a2b;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;

    /* Grautone */
    --color-white: #ffffff;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;

    /* Schatten */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    /* Radien */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Uebergaenge */
    --transition: all 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* ==========================================
   Typography
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { color: var(--color-primary-dark); }

.text-muted { color: var(--color-gray-600); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

/* ==========================================
   Layout
   ========================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* ==========================================
   Header & Navigation
   ========================================== */

.header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon { font-size: 1.5rem; }

.navbar-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.stat-icon { font-size: 1.1rem; }

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
}

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

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

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: white;
}

/* ==========================================
   Buttons
   ========================================== */

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

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

.btn-success:hover:not(:disabled) {
    background: #218838;
    color: white;
}

.btn-warning {
    background: var(--color-warning);
    color: var(--color-gray-900);
}

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

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

.btn-outline:hover:not(:disabled) {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
}

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

.btn-block { width: 100%; }

/* ==========================================
   Cards
   ========================================== */

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

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

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-highlight {
    border: 2px solid var(--color-primary);
}

/* ==========================================
   Forms
   ========================================== */

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.15);
}

.form-help {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-top: 0.25rem;
}

small {
    font-size: 0.8rem;
    color: var(--color-gray-600);
}

/* ==========================================
   Alerts
   ========================================== */

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
}

.alert-close:hover { opacity: 1; }

/* ==========================================
   Progress Bar
   ========================================== */

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

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.progress-bar-fill.bg-warning { background: var(--color-warning); }
.progress-bar-fill.bg-danger { background: var(--color-danger); }

.progress-bar-sm { height: 6px; }
.progress-bar-lg { height: 12px; }

/* ==========================================
   Badges
   ========================================== */

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

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

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

/* ==========================================
   Modal
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 { margin: 0; }

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

.modal-body { padding: 1.25rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-gray-100);
}

/* ==========================================
   Tables
   ========================================== */

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

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

.table th {
    background: var(--color-gray-100);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--color-gray-600);
}

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

.table tbody tr.highlight {
    background: rgba(74, 124, 35, 0.1);
}

/* ==========================================
   Pagination
   ========================================== */

.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: white;
    color: var(--color-gray-700);
    border: 1px solid var(--color-gray-300);
}

.pagination-link:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
}

.pagination-link.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ==========================================
   Footer
   ========================================== */

.footer {
    background: var(--color-gray-800);
    color: var(--color-gray-300);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li { margin-bottom: 0.5rem; }

.footer-section a {
    color: var(--color-gray-400);
}

.footer-section a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid var(--color-gray-700);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ==========================================
   Auth Pages
   ========================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    padding: 2rem;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
}

.auth-header h2 {
    font-size: 1.25rem;
    color: var(--color-gray-600);
    font-weight: 400;
}

.auth-form .form-group { margin-bottom: 1.25rem; }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-gray-200);
}

/* ==========================================
   Page Header
   ========================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 { margin: 0; }

.page-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================
   Empty State
   ========================================== */

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

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 { margin-bottom: 0.5rem; }

.empty-state p { margin-bottom: 1.5rem; }

/* ==========================================
   Utilities
   ========================================== */

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

.inline-form { display: inline; }

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================
   Notifications
   ========================================== */

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--color-gray-800);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 20px));
    transition: transform 0.3s ease;
    z-index: 3000;
}

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

.notification.success { background: var(--color-success); }
.notification.error { background: var(--color-danger); }
