/**
 * Kleingarten-Wertermittlung - Modern Tablet Design
 * Mobile First | Touch Optimized | Rounded Modern UI
 */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #f3f4f6;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--secondary);
    color: var(--text);
    line-height: 1.6;
    -webkit-user-select: none;
    user-select: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:active {
    opacity: 0.8;
}

/* ===== HEADER ===== */
.app-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    color: var(--text);
}

.role-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

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

/* ===== NAVIGATION ===== */
.navbar-menu {
    display: flex;
    padding: 0.5rem;
    gap: 0.5rem;
    overflow-x: auto;
    border-top: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    background: white;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.nav-item:active,
.nav-item--active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

/* ===== MAIN LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: calc(100vh - 200px);
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 48px;
    gap: 0.5rem;
    user-select: none;
}

.btn:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

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

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

.btn--secondary {
    background: white;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn--secondary:active {
    background: var(--secondary);
}

.btn--block {
    width: 100%;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 40px;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.card-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.card--stat {
    border-left: 5px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.card--stat::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0.3;
}

/* ===== GRID ===== */
.grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* ===== ALERTS ===== */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border-left: 5px solid;
    animation: slideIn 0.3s ease;
}

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

.alert--success {
    background: #d1fae5;
    border-color: var(--primary);
    color: #065f46;
}

.alert--error {
    background: #fee2e2;
    border-color: var(--error);
    color: #991b1b;
}

.alert--warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.alert--info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead {
    background: var(--secondary);
    border-bottom: 2px solid var(--border);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

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

.table tbody tr:active {
    background: var(--primary-light);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.badge--abgeschlossen {
    background: var(--primary-light);
    color: #065f46;
}

/* ===== LINKS ===== */
.link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    display: inline-block;
}

.link:active {
    color: var(--primary-dark);
}

.link-list {
    list-style: none;
}

.link-list li {
    margin-bottom: 1rem;
}

.link-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary);
}

.link-list a:active {
    background: var(--primary);
    color: white;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
}

.login-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-form {
    margin-top: 2rem;
}

/* ===== FOOTER ===== */
.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 3rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.app-footer p {
    margin-bottom: 0.5rem;
}

.app-footer p:last-child {
    margin-bottom: 0;
}

/* ===== UTILITY ===== */
.text-center {
    text-align: center;
}

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

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

.mb-3 {
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE: TABLET (768px+) ===== */
@media (min-width: 768px) {
    .header-top {
        padding: 1.5rem 2rem;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 2rem;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 2rem;
    }
    
    .table th,
    .table td {
        padding: 1.5rem;
    }
}

/* ===== RESPONSIVE: LANDSCAPE ===== */
@media (max-width: 600px) and (orientation: landscape) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 1rem;
    }
}

/* ===== RESPONSIVE: SMALL TABLETS ===== */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .grid--3,
    .grid--2 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
    }
    
    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}


/* Select Styling */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}


/* Badge Roles */
.badge--admin {
    background: #fee2e2;
    color: #991b1b;
}

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

