/* ===========================
   CSS VARIABLEN
   =========================== */
   :root {
    --bg: #0f0a07;
    --bg-card: #1f1812;
    --bg-elevated: #2a1f17;
    --bg-input: #15100c;
    --border: #3d2f25;
    --border-light: #4d3d30;
    --primary: #d4a574;
    --primary-hover: #e8b988;
    --primary-dark: #b88a5a;
    --accent: #8b4513;
    --text: #e8d9c0;
    --text-muted: #8a7560;
    --text-dim: #5c4a3a;
    --danger: #c0392b;
    --danger-hover: #e74c3c;
    --success: #27ae60;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

/* ===========================
   HINTERGRUND-LAYER (LOGO + GRADIENT)
   =========================== */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background-color: var(--bg);
    background-image:
        url('../logo.png'),
        radial-gradient(circle at 15% 15%, rgba(139, 69, 19, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(212, 165, 116, 0.08) 0%, transparent 50%);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center center, top left, bottom right;
    background-size: 50% auto, auto, auto;
    background-attachment: fixed, fixed, fixed;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 10, 7, 0.78);
}

/* ===========================
   APP CONTAINER
   =========================== */
.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   HEADER
   =========================== */
.app-header {
    background: rgba(31, 24, 18, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand .logo-img {
    height: 1.4rem;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand h1 {
    font-size: 1.4rem;
    color: var(--primary);
    line-height: 1;
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
    padding: 2rem 1.5rem 4rem;
    flex: 1;
}

/* ===========================
   TOOLBAR
   =========================== */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===========================
   REVIEWS LIST
   =========================== */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ===========================
   REVIEW CARD
   =========================== */
.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-light);
}

.review-image {
    width: 240px;
    aspect-ratio: 1 / 1;
    background: var(--bg-elevated);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-image.placeholder {
    color: var(--text-dim);
}

.placeholder-logo {
    width: 60%;
    max-width: 140px;
    height: auto;
    opacity: 0.3;
    object-fit: contain;
}

.review-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.review-title h3 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.review-manufacturer {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.review-stars {
    color: var(--primary);
    font-size: 1.25rem;
    letter-spacing: 1px;
    white-space: nowrap;
    line-height: 1;
}

.review-stars .empty {
    color: var(--text-dim);
}

/* ===========================
   REVIEW SCALES (Standard: 1 Spalte)
   =========================== */
.review-scales {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem 1.5rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.scale-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    min-width: 0;
}

.scale-item .label {
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.scale-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.scale-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.4s ease;
    border-radius: 3px;
}

.scale-value {
    color: var(--primary);
    font-weight: 600;
    min-width: 36px;
    text-align: right;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.scale-text {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    word-break: break-word;
    flex: 1;
}

.scale-item-wide {
    grid-column: span 1;
}

.review-description {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.review-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.review-meta strong {
    color: var(--text);
    font-weight: 600;
}

.review-actions {
    display: flex;
    gap: 0.4rem;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--border-light);
}

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

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    font-weight: 600;
}

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

.btn-ghost {
    background: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-elevated);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.btn-icon {
    padding: 0.5rem 0.7rem;
    background: transparent;
    font-size: 0.95rem;
}

.btn-icon.favorite-btn.active {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(192, 57, 43, 0.1);
}

.btn-block {
    width: 100%;
}

/* ===========================
   SELECT
   =========================== */
.select {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.65rem 2.2rem 0.65rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%238a7560' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
}

.select:focus {
    outline: none;
    border-color: var(--primary);
}

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

.form-group label {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Kurze Text-Inputs (Geschmack, Dauer, Preis) */
.text-input-short {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    transition: var(--transition);
}

.text-input-short:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.text-input-short::placeholder {
    color: var(--text-dim);
}

/* ===========================
   IMAGE UPLOAD
   =========================== */
.image-upload {
    position: relative;
}

.image-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.image-preview {
    width: 100%;
    height: 200px;
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.image-preview:hover {
    border-color: var(--primary);
}

.image-preview.has-image {
    border-style: solid;
}

.image-preview-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    pointer-events: none;
}

.image-icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* ===========================
   STAR RATING
   =========================== */
.star-rating {
    display: flex;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.star {
    font-size: 1.8rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    line-height: 1;
}

.star:hover, .star.active {
    color: var(--primary);
    transform: scale(1.1);
}

.rating-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===========================
   FORM SCALES (Standard: 1 Spalte)
   =========================== */
.scales {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.5rem;
    padding: 1.1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.scale-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.scale-group label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.scale-group .scale-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 36px;
    text-align: right;
}

.scale-group .scale-value-hint {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.8rem;
    margin-left: auto;
}

/* Custom range slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    border: 2px solid var(--bg);
}

.slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ===========================
   ERROR MESSAGE
   =========================== */
.error-message {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid var(--danger);
    color: #f1948a;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* ===========================
   MODAL
   =========================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.25s ease;
    margin: auto;
}

.modal-small {
    max-width: 440px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.empty-logo {
    width: 120px;
    height: auto;
    opacity: 0.4;
    object-fit: contain;
}

.empty-state h2 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ===========================
   TOAST
   =========================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-elevated);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 2000;
    animation: toastIn 0.3s ease;
    max-width: 360px;
    font-size: 0.95rem;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===========================
   DESKTOP: 2 SPALTEN FÜR SKALEN
   =========================== */
@media (min-width: 1025px) {
    .scales,
    .review-scales {
        grid-template-columns: 1fr 1fr;
    }

    .scale-item-wide {
        grid-column: span 2;
    }
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }

    .brand h1 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .review-card {
        flex-direction: column;
    }

    .review-image {
        width: 100%;
        aspect-ratio: 1 / 1;
        max-height: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .select,
    .toolbar-actions .btn {
        flex: 1;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .brand h1 {
        font-size: 1.15rem;
    }

    .review-header {
        flex-direction: column;
    }

    .modal-content {
        max-height: 95vh;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .review-content {
        padding: 1.1rem;
    }

    .review-title h3 {
        font-size: 1.2rem;
    }

    .star {
        font-size: 1.5rem;
    }
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
