/* =============================================================
   Artiee — Mobile-first stylesheet
   Colors:
     Primary gradient: #2c6d43 → #b8d2b7
     Accent:           #544333
     Highlight:        #fbcf66 / #fbd99a
     Background:       #fdfffe
   ============================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fdfffe;
    color: #333;
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
}

#app-wrapper {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100dvh;
    position: relative;
    background: #fdfffe;
}

main {
    padding: 0 16px 80px;
}

a { color: #2c6d43; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Loading overlay ---------- */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #fdfffe;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loader-content { text-align: center; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid #b8d2b7;
    border-top-color: #2c6d43;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c6d43;
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 10000;
    transition: opacity .3s, transform .3s;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(44,109,67,.3);
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-20px); }
.toast.error { background: #d44; }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: #fff;
    border-top: 1px solid #e8ebe8;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,.04);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 11px;
    padding: 4px 8px;
    transition: color .2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
    width: 24px; height: 24px;
    margin-bottom: 2px;
    stroke: currentColor;
}
.nav-item.active { color: #2c6d43; }
.nav-item:active { transform: scale(.95); }

/* ---------- Hero (home page) ---------- */
.hero {
    background: linear-gradient(135deg, #2c6d43 0%, #b8d2b7 100%);
    margin: 0 -16px;
    padding: 48px 24px 36px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 20px;
}
.hero h1 {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}
.hero-subtitle {
    color: rgba(255,255,255,.85);
    font-size: 16px;
    margin-top: 4px;
}

/* ---------- Home grid ---------- */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    padding: 20px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    text-decoration: none;
    color: #333;
    transition: transform .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
}
.home-card:active { transform: scale(.97); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.home-card-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #2c6d43, #b8d2b7);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.home-card-icon svg {
    width: 24px; height: 24px;
    stroke: #fff;
}
.home-card span {
    font-size: 14px;
    font-weight: 600;
}

/* ---------- Page header ---------- */
.page-header {
    padding: 20px 0 12px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #2c6d43;
}

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.note-card {
    background: linear-gradient(135deg, #fbd99a, #fbcf66);
    color: #544333;
}
.note-card p { font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .1s, opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-primary {
    background: linear-gradient(135deg, #2c6d43, #3d8a59);
    color: #fff;
}
.btn-secondary {
    background: #eee;
    color: #555;
}
.btn-outline {
    background: transparent;
    color: #2c6d43;
    border: 1.5px solid #2c6d43;
}
.btn-accent {
    background: linear-gradient(135deg, #fbcf66, #f0b840);
    color: #544333;
}
.btn-danger {
    background: #e55;
    color: #fff;
}

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn-row .btn { flex: 1; }

/* ---------- Toggle button ---------- */
.toggle-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #ccc;
    background: #f5f5f5;
    color: #888;
    cursor: pointer;
    transition: all .2s;
}
.toggle-btn.active {
    border-color: #2c6d43;
    background: #e8f5ec;
    color: #2c6d43;
}

/* ---------- Inputs ---------- */
.input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
    background: #fff;
    margin-top: 8px;
}
.input:focus { border-color: #2c6d43; }
.textarea { min-height: 80px; resize: vertical; }

/* ---------- Profile card ---------- */
.profile-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    margin-bottom: 12px;
}
.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel img {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.profile-info {
    padding: 14px 16px;
}
.profile-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.profile-info p {
    font-size: 14px;
    color: #555;
    margin-bottom: 4px;
}
.profile-channel {
    font-size: 13px;
    color: #888;
}
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rating-badge {
    background: linear-gradient(135deg, #fbcf66, #f0b840);
    color: #544333;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ---------- Stats ---------- */
.stats-card h4 { margin-bottom: 12px; color: #2c6d43; }
.stats-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.stat-item {
    flex: 1;
    text-align: center;
    background: #f7faf7;
    border-radius: 12px;
    padding: 12px 8px;
}
.stat-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2c6d43;
}
.stat-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.profile-settings {
    border-top: 1px solid #eee;
    padding-top: 12px;
}
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.setting-row span { font-size: 14px; }

/* ---------- Viewer badge ---------- */
.viewer-badge {
    display: inline-block;
    background: linear-gradient(135deg, #b8d2b7, #2c6d43);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- Photo upload ---------- */
.upload-area { margin: 8px 0; }
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}
.photo-grid .photo-thumb {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.photo-grid .photo-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.photo-grid .photo-thumb .remove-photo {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Feed ---------- */
.feed-profile-card { margin-bottom: 8px; }
.feed-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.feed-actions .btn { flex: 1; }
.feed-actions-secondary {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.feed-actions-secondary .btn { flex: 1; }

/* ---------- Rating grid ---------- */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.rating-grid .rate-btn {
    aspect-ratio: 1;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rating-grid .rate-btn:active { transform: scale(.93); }
.rating-grid .rate-btn.selected {
    background: #2c6d43;
    color: #fff;
    border-color: #2c6d43;
}

/* ---------- Report reasons ---------- */
.report-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---------- Empty state ---------- */
.empty-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ---------- Contest ---------- */
.contest-info-card h3 {
    color: #2c6d43;
    margin-bottom: 8px;
}
.contest-description {
    background: #f7faf7;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 14px;
}
.contest-meta { font-size: 14px; }
.meta-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}
.meta-label {
    color: #888;
    min-width: 120px;
    flex-shrink: 0;
}

/* Contest tabs */
.contest-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.contest-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid #ddd;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
    background: #2c6d43;
    color: #fff;
    border-color: #2c6d43;
}

/* Contest work card */
.contest-work-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    margin-bottom: 12px;
}
.contest-work-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.work-info {
    padding: 12px 16px;
}
.work-info h4 { margin-bottom: 2px; }

/* Vote buttons */
.vote-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-vote-like, .btn-vote-dislike {
    width: 64px; height: 64px;
    border-radius: 50%;
    font-size: 28px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
}
.btn-vote-like { background: #e8f5ec; }
.btn-vote-dislike { background: #fce8e8; }
.btn-vote-like:active, .btn-vote-dislike:active { transform: scale(.9); }
.btn-vote-like.voted { background: #2c6d43; box-shadow: 0 3px 16px rgba(44,109,67,.3); }
.btn-vote-dislike.voted { background: #d44; box-shadow: 0 3px 16px rgba(204,68,68,.3); }

/* Contest preview */
.contest-preview {
    border-radius: 12px;
    overflow: hidden;
    margin: 8px 0;
}
.contest-preview img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Rating list */
.rating-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.rating-place {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbcf66, #f0b840);
    color: #544333;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rating-entry:nth-child(1) .rating-place { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.rating-entry:nth-child(2) .rating-place { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #fff; }
.rating-entry:nth-child(3) .rating-place { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.rating-info { flex: 1; }
.rating-name { font-weight: 600; font-size: 14px; }
.rating-score {
    color: #2c6d43;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

/* ---------- Accordion (info page) ---------- */
.info-section { padding: 0; overflow: hidden; }
.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.accordion-arrow {
    width: 20px; height: 20px;
    transition: transform .3s;
    flex-shrink: 0;
}
.accordion-arrow.rotated { transform: rotate(180deg); }
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
    padding: 0 16px;
}
.accordion-body.open {
    max-height: 2000px;
    padding: 0 16px 16px;
}
.accordion-body h4 { color: #2c6d43; margin: 12px 0 6px; }
.accordion-body ul, .accordion-body ol { padding-left: 20px; margin-bottom: 8px; }
.accordion-body li { margin-bottom: 4px; font-size: 14px; }
.accordion-body p { font-size: 14px; margin-bottom: 6px; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: #999; }
.welcome-text { text-align: center; padding: 8px 0; }
.welcome-text p { color: #888; font-size: 14px; }

/* ---------- Form steps ---------- */
.form-step h3 { margin-bottom: 8px; }

/* ---------- Responsive: slightly larger on tablets ---------- */
@media (min-width: 480px) {
    .hero { padding: 56px 32px 44px; }
    .hero h1 { font-size: 38px; }
    .home-grid { gap: 16px; }
}
