/**
 * Sutrekopp.no - Stylesheet
 * Dark, moody, grumpy-but-fun aesthetic
 */

/* ========================================
   Reset & Base
   ======================================== */

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

:root {
    --bg-deep:      #141210;
    --bg-primary:   #1a1714;
    --bg-card:      #222019;
    --bg-card-hover:#2a2720;
    --bg-elevated:  #2e2a25;
    --border:       #3a3530;
    --border-light: #4a4438;

    --text-primary:   #f0e8dc;
    --text-secondary: #b5a898;
    --text-muted:     #7a7168;
    --text-faint:     #5a5248;

    --accent:       #d4854a;
    --accent-light: #e8a664;
    --accent-dim:   rgba(212, 133, 74, 0.12);
    --accent-glow:  rgba(212, 133, 74, 0.25);

    --danger:       #c44a4a;
    --success:      #5a9a5a;

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-full: 50px;

    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(212, 133, 74, 0.1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-light);
}

/* ========================================
   Layout
   ======================================== */

.site-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ========================================
   Header
   ======================================== */

.site-header {
    padding: 2rem 0 1rem;
    text-align: center;
    position: relative;
}

.site-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.site-logo .accent {
    color: var(--accent);
}

.site-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   Sutt-o-meter
   ======================================== */

.meter-section {
    margin: 1.5rem 0;
}

.meter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.meter-emoji {
    font-size: 2.4rem;
    flex-shrink: 0;
}

.meter-info {
    flex: 1;
    min-width: 0;
}

.meter-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

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

.meter-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.meter-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    flex-shrink: 0;
    text-align: right;
    line-height: 1;
}

.meter-count small {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ========================================
   Submit Form
   ======================================== */

.submit-section {
    margin: 1.5rem 0;
}

.submit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
}

.submit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.submit-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.submit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.85rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

.submit-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.submit-textarea::placeholder {
    color: var(--text-faint);
}

.submit-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.submit-char-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}

.submit-char-count.over-limit {
    color: var(--danger);
    font-weight: 700;
}

.category-select {
    padding: 0.5rem 0.85rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237a7168' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
}

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

.submit-btn {
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.submit-btn:hover {
    background: var(--accent-light);
}

.submit-btn:active {
    transform: scale(0.98);
}

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

.submit-feedback {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    display: none;
}

.submit-feedback.success {
    display: block;
    background: rgba(90, 154, 90, 0.12);
    color: var(--success);
    border: 1px solid rgba(90, 154, 90, 0.25);
}

.submit-feedback.error {
    display: block;
    background: rgba(196, 74, 74, 0.12);
    color: var(--danger);
    border: 1px solid rgba(196, 74, 74, 0.25);
}

/* ========================================
   Filter Bar
   ======================================== */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 0.85rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.filter-sort {
    margin-left: auto;
}

.sort-select {
    padding: 0.4rem 0.7rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237a7168' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

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

/* ========================================
   Complaint Cards
   ======================================== */

.complaints-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.complaint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
    animation: fadeIn 0.3s ease;
}

.complaint-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.complaint-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.complaint-category {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

.complaint-time {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-left: auto;
}

.complaint-content {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    word-break: break-word;
}

.complaint-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.reaction-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
}

.reaction-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.reaction-btn .emoji {
    font-size: 0.95rem;
}

.reaction-btn .count {
    font-weight: 500;
}

.complaint-more {
    margin-left: auto;
    position: relative;
}

.more-btn {
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.more-btn:hover {
    color: var(--text-muted);
}

.more-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0;
    min-width: 150px;
    z-index: 10;
    box-shadow: var(--shadow-card);
}

.more-menu.open {
    display: block;
}

.more-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.85rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.more-menu-item:hover {
    background: var(--bg-card);
}

.more-menu-item.danger {
    color: var(--danger);
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem;
}

.pagination-btn {
    padding: 0.45rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-deep);
    font-weight: 700;
}

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

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

/* ========================================
   Loading & Empty States
   ======================================== */

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

.loading-spinner::after {
    content: '😤';
    display: block;
    font-size: 2rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

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

.empty-state .emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

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

/* ========================================
   Toast notifications
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease;
    max-width: 320px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

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

/* ========================================
   Footer
   ======================================== */

.site-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-disclaimer {
    font-style: italic;
    color: var(--text-faint);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    font-size: 0.78rem;
    color: var(--text-faint);
}

.footer-links a {
    color: var(--text-muted);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 600px) {
    .site-logo {
        font-size: 2rem;
    }

    .meter-card {
        padding: 1rem;
        gap: 0.85rem;
    }

    .meter-emoji {
        font-size: 1.8rem;
    }

    .meter-count {
        font-size: 1.4rem;
    }

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

    .submit-char-count {
        margin-left: 0;
        text-align: right;
    }

    .submit-btn {
        width: 100%;
        text-align: center;
    }

    .filter-bar {
        gap: 0.35rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .complaint-actions {
        gap: 0.1rem;
    }

    .reaction-btn {
        padding: 0.25rem 0.45rem;
        font-size: 0.72rem;
    }
}
