/* ============================================================
   Portal de Sugerencias — Modern UI
   Design tokens
   ============================================================ */
:root {
    /* Surfaces & text — built from BLACK rgba(50,40,50,1) */
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-muted: #eef3f8;
    --color-border: #e2e8ef;
    --color-border-strong: #ccd5de;
    --color-text: rgba(50, 40, 50, 1);
    --color-text-muted: rgba(50, 40, 50, 0.65);
    --color-text-subtle: rgba(50, 40, 50, 0.45);

    /* Brand: light blue (MENU_COLOR #25AAE1) + deep purple (#262262) */
    --color-primary: #25AAE1;
    --color-primary-strong: #1A8FBF;
    --color-primary-soft: #e6f5fc;
    --color-primary-light: #39b6ec;
    --color-accent: #262262;
    --color-accent-soft: #ebebf4;

    --color-success: #4BC0C0;
    --color-success-soft: #e8f7f7;

    --color-danger: #CF2127;
    --color-danger-soft: #fbe8e9;
    --color-danger-button: rgba(217, 83, 79, 0.9);

    --color-warning: #F1C714;
    --color-warning-soft: #fdf6dc;

    --color-orange: #FF9F40;

    /* Brand gradients: suave dentro del azul de marca */
    --gradient-primary: linear-gradient(180deg, #2EB2E6 0%, #1F9CCC 100%);
    --gradient-hero: linear-gradient(135deg, #2EB2E6 0%, #1A8FBF 100%);
    --gradient-success: linear-gradient(180deg, #56C9C9 0%, #3CACAC 100%);
    --gradient-danger: linear-gradient(180deg, #D6383D 0%, #B7232A 100%);

    --shadow-xs: 0 1px 2px rgba(50, 40, 50, 0.06);
    --shadow-sm: 0 2px 6px rgba(50, 40, 50, 0.07), 0 1px 2px rgba(50, 40, 50, 0.04);
    --shadow-md: 0 8px 20px rgba(50, 40, 50, 0.09), 0 2px 4px rgba(50, 40, 50, 0.04);
    --shadow-lg: 0 18px 40px rgba(38, 34, 98, 0.18), 0 4px 12px rgba(50, 40, 50, 0.07);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ============================================================
   Base
   ============================================================ */
html {
    font-size: 15px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    background-image:
        radial-gradient(1100px 600px at -10% -20%, rgba(37, 170, 225, 0.12), transparent 60%),
        radial-gradient(900px 500px at 110% 0%, rgba(38, 34, 98, 0.10), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

a {
    color: var(--color-primary-strong);
    text-decoration: none;
    transition: color .15s var(--ease);
}

a:hover { color: var(--color-primary); }

::selection {
    background: rgba(37, 170, 225, 0.28);
    color: var(--color-text);
}

/* Focus styles */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.40);
    border-radius: 6px;
}

/* ============================================================
   Layout
   ============================================================ */
.app-main {
    flex: 1 0 auto;
    padding: 28px 0 64px;
}

/* Navbar */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
    font-weight: 700;
}

.brand:hover { color: var(--color-text); }

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-tag { font-size: 0.72rem; font-weight: 500; color: var(--color-text-subtle); }

.nav-link-modern {
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all .15s var(--ease);
}
.nav-link-modern:hover {
    color: var(--color-primary-strong);
    background: var(--color-primary-soft);
}

/* Footer */
.app-footer {
    flex-shrink: 0;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
}

/* ============================================================
   Page header (compact, neutral)
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px 0 18px;
}

.page-header-text { min-width: 0; }

.page-header h1 {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.page-header p {
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: .95rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.32);
    outline: none;
}

.btn-primary, .btn-primary-modern {
    background: var(--gradient-primary);
    background-color: var(--color-primary);
    border: none;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(37, 170, 225, 0.30), 0 1px 2px rgba(50, 40, 50, 0.08);
}
.btn-primary:hover, .btn-primary-modern:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 170, 225, 0.35), 0 2px 4px rgba(50, 40, 50, 0.10);
    filter: brightness(1.04);
}
.btn-primary:active, .btn-primary-modern:active { transform: translateY(0); filter: brightness(.98); }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary-strong);
    border: 1.5px solid var(--color-primary);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}
.btn-secondary:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    border-color: var(--color-primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 170, 225, 0.20);
}

.btn-outline-primary {
    color: var(--color-primary-strong);
    border-color: var(--color-primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--color-text-muted);
    border-color: var(--color-border-strong);
    background: var(--color-surface);
}
.btn-outline-secondary:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    border-color: var(--color-primary);
}

.btn-success {
    background: var(--gradient-success);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px rgba(75, 192, 192, 0.32);
}
.btn-success:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(75, 192, 192, 0.42);
}

.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }

/* ============================================================
   Toolbar / Search
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-shell {
    flex: 1 1 320px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: 4px 4px 4px 16px;
    transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}

.search-shell:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.22);
}

.search-shell .bi-search {
    color: var(--color-text-subtle);
    font-size: 1rem;
    margin-right: 8px;
}

.search-shell input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 6px;
    font-size: .98rem;
    color: var(--color-text);
}
.search-shell input::placeholder { color: var(--color-text-subtle); }

.search-shell .btn {
    border-radius: var(--radius-sm);
    padding: 8px 18px;
}

/* ============================================================
   Cards / Suggestions list
   ============================================================ */
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 4px 4px 14px;
}
.section-heading h2 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--color-text);
}
.section-heading .count-pill {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.suggestion-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.suggestion-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity .2s var(--ease);
}

.suggestion-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
}

.suggestion-card:hover::before { opacity: 1; }

.suggestion-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.suggestion-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}
.suggestion-title a {
    color: inherit;
    background-image: linear-gradient(var(--color-primary), var(--color-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .2s var(--ease), color .2s var(--ease);
}
.suggestion-title a:hover {
    color: var(--color-primary-strong);
    background-size: 100% 2px;
}

.suggestion-description {
    color: var(--color-text-muted);
    font-size: .94rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.suggestion-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
}

.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: .85rem;
    font-weight: 500;
    min-width: 0;
}

.avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(38, 34, 98, 0.28);
}

.author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vote-cluster {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vote-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--color-success-soft);
    color: #2fa6a6;
    font-weight: 700;
    font-size: .85rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(75, 192, 192, 0.30);
}

.btn-vote {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-primary-strong);
    border: 1px solid var(--color-border-strong);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: all .15s var(--ease);
}
.btn-vote:hover {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 170, 225, 0.25);
}
.btn-vote:active { transform: translateY(0); }
.btn-vote.voted {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(37, 170, 225, 0.30);
}

/* Empty / Hint states */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    background: var(--color-surface);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
}
.empty-state .bi {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}
.empty-state h3 {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 6px;
}

.list-hint {
    color: var(--color-text-subtle);
    font-size: .85rem;
    margin-top: 14px;
    text-align: center;
}

/* ============================================================
   Forms (Create Suggestion)
   ============================================================ */
.card-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.card-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.card-panel-title .icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.card-panel-subtitle {
    color: var(--color-text-muted);
    margin: 0 0 22px;
    font-size: .95rem;
}

.form-label {
    font-weight: 600;
    color: var(--color-text);
    font-size: .9rem;
    margin-bottom: 6px;
}

.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    padding: 10px 14px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    font-size: .98rem;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.22);
}

.form-control::placeholder { color: var(--color-text-subtle); }

textarea.form-control { resize: vertical; min-height: 120px; }

.text-danger {
    color: var(--color-danger) !important;
    font-size: .85rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

/* ============================================================
   Suggestion Details page
   ============================================================ */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    color: var(--color-primary-strong);
    background: var(--color-surface);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
    transition: all .15s var(--ease);
}
.detail-back:hover {
    color: var(--color-primary-strong);
    background: var(--color-primary-soft);
    border-color: var(--color-primary-strong);
    transform: translateX(-2px);
    box-shadow: 0 4px 10px rgba(37, 170, 225, 0.20);
}

.detail-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.detail-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: var(--gradient-primary);
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.detail-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 22px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    border-radius: var(--radius-pill);
    font-size: .85rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
}
.meta-chip .bi { color: var(--color-primary); }

.detail-body {
    color: var(--color-text);
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 24px;
    white-space: pre-line;
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
}

/* ============================================================
   Error page
   ============================================================ */
.error-panel {
    text-align: center;
    padding: 48px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}
.error-panel .icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.suggestion-card,
.card-panel,
.detail-card,
.hero,
.empty-state {
    animation: fadeUp .35s var(--ease) both;
}

@keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.vote-pop { animation: pop .35s var(--ease); }

/* ============================================================
   Utilities
   ============================================================ */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--color-text-subtle);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 576px) {
    .hero { padding: 28px 22px; }
    .card-panel { padding: 22px; }
    .detail-card { padding: 24px; }
    .app-main { padding: 18px 0 40px; }
}
