/* ===== Tapeame.com — Styles ===== */

:root {
    --cream: #F5EFE0;
    --terracota: #C0593B;
    --terracota-dark: #A34830;
    --olive: #6B7F4E;
    --olive-light: #8BA368;
    --gold: #D4A843;
    --text: #2D2D2D;
    --text-light: #6B6B6B;
    --card: #FFFFFF;
    --border: #E5DED0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--cream);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* --- Header --- */
.header {
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--terracota);
    font-weight: 700;
}
.logo span { color: var(--text); font-style: normal; font-weight: 400; }
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.btn-add-tapa {
    background: var(--olive);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid var(--olive);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-add-tapa:hover {
    background: var(--olive-light);
    border-color: var(--olive-light);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
}
.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.25rem;
}

/* --- Mobile menu --- */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--card);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 100;
    padding: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}
.mobile-menu-overlay.open { display: block; }
.mobile-menu a, .mobile-menu button {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    color: var(--text);
}
.mobile-menu .close-btn {
    align-self: flex-end;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
}

/* --- Feed / Cards --- */
.feed {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.tapa-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}
.tapa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.tapa-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.tapa-card-body {
    padding: 0.875rem;
}
.tapa-card-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}
.tapa-card-bar h3 {
    font-size: 1.05rem;
    font-weight: 700;
}
.tapa-card-bar .city {
    font-size: 0.8rem;
    color: var(--text-light);
}
.tapa-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}
.tapa-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.375rem;
}
.stars {
    color: var(--gold);
    letter-spacing: 1px;
}
.tapa-card-desc {
    font-size: 0.825rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.4;
}

/* --- Stars rating input --- */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.25rem;
    justify-content: flex-end;
}
.star-rating input { display: none; }
.star-rating label {
    font-size: 2rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.1s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--gold);
}

/* --- Forms --- */
.form-page {
    max-width: 480px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.form-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.form-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(107, 127, 78, 0.15);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* --- Photo upload --- */
.photo-upload {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    overflow: hidden;
}
.photo-upload:hover {
    border-color: var(--olive);
    background: rgba(107, 127, 78, 0.05);
}
.photo-upload.has-photo {
    padding: 0;
    border-style: solid;
    border-color: var(--olive);
}
.photo-upload .icon {
    font-size: 2.5rem;
    color: var(--olive);
    margin-bottom: 0.5rem;
}
.photo-upload .text {
    color: var(--text-light);
    font-size: 0.9rem;
}
.photo-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.photo-upload .preview {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-align: center;
}
.btn-primary {
    background: var(--terracota);
    color: white;
    width: 100%;
}
.btn-primary:hover {
    background: var(--terracota-dark);
}
.btn-outline {
    background: transparent;
    color: var(--olive);
    border: 2px solid var(--olive);
}
.btn-outline:hover {
    background: var(--olive);
    color: white;
}
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* --- Bar search / autocomplete --- */
.bar-search {
    position: relative;
}
.bar-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
    display: none;
}
.bar-results.open { display: block; }
.bar-result-item {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.bar-result-item:hover { background: rgba(107, 127, 78, 0.08); }
.bar-result-item .bar-name { font-weight: 600; }
.bar-result-item .bar-address { font-size: 0.8rem; color: var(--text-light); }

/* --- Messages --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

/* --- Footer --- */
.footer {
    margin-top: auto;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}
.footer a { color: var(--olive); }
.footer a:hover { text-decoration: underline; }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* --- Share button --- */
.share-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    transition: color 0.15s;
}
.share-btn:hover { color: var(--olive); }
.share-btn i { margin-right: 0.25rem; }
.tapa-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 0.875rem 0.75rem;
}

/* --- Toast / Modal --- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--olive);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 200;
    text-align: center;
    max-width: 360px;
    width: 90%;
    animation: toastIn 0.3s ease;
}
.toast h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.toast p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}
.toast-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.toast-actions button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.toast-share {
    background: white;
    color: var(--olive);
}
.toast-close {
    background: rgba(255,255,255,0.2);
    color: white;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Misc --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .feed-grid {
        grid-template-columns: 1fr;
    }
    .header-inner {
        padding: 0;
    }
}
