/**
 * ============================================
 * Flohmarkt Verwaltung - Custom Styles
 * Ultra-modernes UI/UX Design
 * ============================================
 */

/* ====== CSS Variables ====== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
    
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
    
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ====== Base Styles ====== */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    padding-top: 105px !important; /* Navbar (56px) + Event-Info-Bar (49px) für Desktop mit Event */
}

body.login-page,
body.select-event-page {
    padding-top: 0 !important; /* Keine fixe Navbar auf Login/Event-Auswahl */
}

@media (max-width: 991.98px) {
    body {
        padding-top: 70px !important; /* Nur Navbar auf Mobile */
    }
    
    body.login-page,
    body.select-event-page {
        padding-top: 0 !important;
    }
}

/* ====== Navbar ====== */
.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.navbar {
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

/* ====== Cards ====== */
.card {
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

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

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ====== Stat Cards ====== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

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

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

.table > thead {
    background-color: #f8fafc;
}

.table > thead > tr > th {
    border-bottom: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 1rem;
}

.table > tbody > tr {
    transition: var(--transition);
}

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

.table > tbody > tr > td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* ====== Badges ====== */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-primary-subtle {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.1) !important;
}

/* ====== Buttons ====== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: var(--primary-gradient);
}

.btn-success {
    background: var(--success-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: var(--success-gradient);
}

.btn-outline-secondary.active,
.btn-outline-warning.active,
.btn-outline-success.active {
    transform: scale(1.02);
}

/* ====== Stand Grid ====== */
.stand-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.stand-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: default;
    transition: var(--transition);
}

.stand-cell:hover {
    transform: scale(1.1);
    z-index: 1;
}

/* ====== Login Page ====== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 20px;
}

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

.login-header {
    background: var(--primary-gradient);
    padding: 40px;
    text-align: center;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    opacity: 0.9;
    margin-bottom: 0;
}

.login-body {
    padding: 40px;
}

.login-body .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.login-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-body .btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border-radius: 10px;
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-body .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ====== Form Elements ====== */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

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

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(34, 211, 238, 0.1) 100%);
    color: #155e75;
}

/* ====== Modals ====== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}

/* ====== Progress Bar ====== */
.progress {
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

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

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

.card {
    animation: fadeIn 0.3s ease-out;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .stand-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .table > thead {
        display: none;
    }
    
    .table > tbody > tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-sm);
    }
    
    .table > tbody > tr > td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .table > tbody > tr > td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

@media (max-width: 576px) {
    .login-card {
        margin: 10px;
    }
    
    .login-header {
        padding: 30px;
    }
    
    .login-body {
        padding: 30px;
    }
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ====== Selection ====== */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #1e293b;
}

/* ====== Payment Page ====== */
.payment-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    padding: 20px;
}

.payment-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
}

.payment-header {
    background: var(--primary-gradient);
    padding: 40px;
    text-align: center;
    color: white;
}

.payment-body {
    padding: 40px;
}

.payment-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
}

.payment-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.payment-details p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.payment-details p:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
