@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --rose-pine-light: (
        base: #faf4ed,
        surface: #fffaf3,
        overlay: #f2e9de,
        muted: #9893a5,
        subtle: #797593,
        text: #575279,
        love: #b41d73,
        gold: #ea9d34,
        rose: #d7827e,
        pine: #286983,
        foam: #56949f,
        iris: #907aa9,
        highlight-low: #f4ede8,
        highlight-med: #dfdad9,
        highlight-high: #cecacd
    );
    --rose-pine-dark: (
        base: #191724,
        surface: #1f1d2e,
        overlay: #26233a,
        muted: #6e6a86,
        subtle: #908caa,
        text: #e0def4,
        love: #eb6f92,
        gold: #f6c177,
        rose: #ebbcba,
        pine: #31748f,
        foam: #9ccfd8,
        iris: #c4a7e7,
        highlight-low: #21202e,
        highlight-med: #403d52,
        highlight-high: #524f67
    );
}

[data-theme='light'] {
    --bg-base: #faf4ed;
    --bg-surface: #fffaf3;
    --bg-overlay: #f2e9de;
    --text-color: #575279;
    --text-muted: #9893a5;
    --text-subtle: #797593;
    --color-gold: #ea9d34;
    --color-love: #b41d73;
    --highlight-med: #dfdad9;
}

[data-theme='dark'] {
    --bg-base: #191724;
    --bg-surface: #1f1d2e;
    --bg-overlay: #26233a;
    --text-color: #e0def4;
    --text-muted: #6e6a86;
    --text-subtle: #908caa;
    --color-gold: #f6c177;
    --color-love: #eb6f92;
    --highlight-med: #403d52;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

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

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

header h1 { font-size: 2.5rem; color: var(--color-love); }

.meta-controls { display: flex; align-items: center; gap: 1.5rem; }

.stats { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; color: var(--text-subtle); }
.stats #average-rating { color: var(--color-gold); font-weight: bold; }

#theme-toggle {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: var(--text-subtle);
    transition: color 0.2s;
}
#theme-toggle:hover { color: var(--text-color); }

#testimonial-grid, #admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.testimonial-card, .admin-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--highlight-med);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.testimonial-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

.card-header { display: flex; justify-content: space-between; align-items: center; }
.card-header .name { font-size: 1.2rem; font-weight: 700; }

.star-rating .fa-star { color: var(--color-gold); }
.star-rating .fa-star.empty { color: var(--highlight-med); }

.comment { flex-grow: 1; }
.date { font-size: 0.9rem; color: var(--text-muted); text-align: right; }

footer { text-align: center; margin-top: 3rem; color: var(--text-muted); }

/* Form Styles */
.form-container { max-width: 600px; }
form { display: flex; flex-direction: column; gap: 1rem; }
input, textarea { 
    padding: 0.8rem; background-color: var(--bg-overlay);
    border: 1px solid var(--highlight-med); border-radius: 4px;
    color: var(--text-color); font-family: inherit; font-size: 1rem; 
}
textarea { resize: vertical; }
button {
    padding: 0.8rem 1.5rem; background-color: var(--color-love);
    color: var(--bg-base); border: none; border-radius: 4px; cursor: pointer;
    font-weight: bold; font-size: 1rem; transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
button:disabled { background-color: var(--text-muted); cursor: not-allowed; }

.star-rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating-input input { display: none; }
.star-rating-input label { font-size: 2rem; color: var(--highlight-med); cursor: pointer; transition: color 0.2s; }
.star-rating-input input:checked ~ label, .star-rating-input label:hover, .star-rating-input label:hover ~ label { color: var(--color-gold); }

#form-status { margin-top: 1rem; font-weight: bold; }
#form-status.success { color: var(--color-gold); }
#form-status.error { color: var(--color-love); }

/* Admin Styles */
.admin-card { display: flex; flex-direction: column; }
.admin-card .info { flex-grow: 1; }
.admin-card button.delete-btn {
    background-color: var(--color-love); font-size: 0.9rem; padding: 0.5rem 1rem;
    align-self: flex-end;
}

/* Loader */
.loader { 
    border: 4px solid var(--highlight-med); border-top: 4px solid var(--color-love);
    border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite;
    margin: 3rem auto; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
