/* --- MODERN & RESPONSIVE CSS FOR BOXORGANIZER --- */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --primary-dark: #312e81;
    --success: #059669;
    --success-light: #d1fae5;
    --success-dark: #064e3b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 1.25rem 1rem;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-badge {
    font-size: 0.7rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius) / 2);
    transition: background 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Layout Grid */
.main-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Ab mittleren Bildschirmen (Tablets/PCs) wird es 3-spaltig */
@media (min-width: 768px) {
    .app-grid {
        grid-template-columns: 1fr 2fr;
    }
    .sticky-sidebar {
        position: sticky;
        top: 2rem;
    }
}

/* Card Styles */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Sprachassistent Box */
.ai-section {
    border-left: 4px solid var(--primary);
    background: linear-gradient(to right, #ffffff, #f5f3ff);
}

.pulse-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    position: relative;
}

.pulse-indicator::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

.ai-response {
    margin-top: 1.25rem;
    padding: 1rem;
    background-color: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-radius: calc(var(--radius) - 4px);
    color: var(--primary-dark);
}

.ai-response-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

/* Scan-Resultat Box */
.scan-section {
    background: linear-gradient(135deg, var(--success-light), #f0fdf4);
    border: 1px solid #a7f3d0;
}

.scan-title { color: var(--success-dark); }
.scan-location { color: var(--success); font-size: 0.9rem; margin-bottom: 1rem; }

.item-list {
    list-style: none;
    background-color: white;
    border-radius: calc(var(--radius) - 4px);
    padding: 0.5rem 1rem;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

.item-list li {
    padding: 0.75rem 0;
    font-weight: 500;
    color: #334155;
}

.item-list li:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

/* Formular Elemente */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) / 1.5);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: calc(var(--radius) / 1.5);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Boxen Grid & Karten */
.boxes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.badge-count {
    font-size: 0.8rem;
    background-color: #e2e8f0;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
}

.boxes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .boxes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.box-card {
    display: flex;
    flex-col: column;
    justify-content: space-between;
    height: 100%;
}

.box-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.box-badge {
    font-size: 0.75rem;
    background-color: #f0fdf4;
    color: var(--success);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.box-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

/* QR-Code Footer in der Kiste */
.qr-footer {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qr-image {
    width: 70px;
    height: 70px;
    background-color: white;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.qr-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.btn-mini {
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-mini-white {
    background-color: white;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-mini-white:hover { background-color: #f1f5f9; }

.btn-mini-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.btn-mini-primary:hover { background-color: #dbecff; }

/* Utilities */
.hidden { display: none !important; }
.italic { font-style: italic; }
.status-text { font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s; }
.status-listening { color: var(--primary); font-weight: 700; }