:root {
    --primary-color: #ff7b00;
    --bg-color: #f6f8fa;
    --card-bg: #ffffff;
    --text-color: #24292e;
    --accent-color: #2dba4e;
}

body.dark-mode {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-color: #e6edf3;
    --primary-color: #ff7b00;
    --accent-color: #2dba4e;
}

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

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

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

header {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle.active {
    box-shadow: 0 0 0 4px rgba(255, 183, 77, 0.15);
    transform: scale(1.05);
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* When global glitter is enabled we hide the default cursor */
/* When glitter is enabled, keep the cursor visible and let sparkles follow it */
body.glitter-enabled { cursor: auto; }

/* Quando o usuário está digitando em um campo, preserve o cursor de texto */
body.glitter-enabled input,
body.glitter-enabled textarea,
body.glitter-enabled [contenteditable] {
    cursor: text !important;
}

.logo {
    max-width: 150px;
    height: auto;
}

.github-logo {
    width: 50px;
    height: 50px;
}

header h1 {
    font-family: 'Kalam', cursive;
    font-size: 3rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

/* Seção de estatísticas */
.stats-section {
    margin-bottom: 20px;
}

details#stats-details summary {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    margin-bottom: 8px;
}

.stats-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 12px;
}

.chart-wrapper {
    background-color: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.chart-wrapper { height: 260px; }

/* Responsividade do canvas */
.chart-wrapper canvas {
    width: 100% !important;
    height: auto !important;
}

.search-bar {
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    max-width: 600px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode #search-input {
    border-color: #30363d;
}

.search-bar .btn {
    margin-left: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.search-bar .btn:hover {
    filter: brightness(1.05);
}

.message-card.highlight {
    outline: 3px solid var(--accent-color);
    box-shadow: 0 0 0 4px rgba(45, 186, 78, 0.25);
    transform: scale(1.01);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.message-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s ease;
    border-top: 5px solid var(--accent-color);
    display: flex;
    flex-direction: column;
}

body.dark-mode .message-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.message-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.message-content {
    font-family: 'Kalam', cursive;
    font-size: 1.3rem;
    margin-bottom: 20px;
    flex-grow: 1;
    color: #333;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.card-header .message-content {
    flex: 1;
    margin-bottom: 0;
}

.card-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.copy-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-button:hover {
    background-color: #25a03b;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(45, 186, 78, 0.3);
}

.copy-button:active {
    transform: scale(0.98);
}

.copy-button.copied {
    background-color: var(--accent-color);
    animation: copyPulse 0.3s ease-in-out;
}

.copy-button.copy-error {
    background-color: #d1242f;
}

/* Glitter cursor effect */
.glitter-hover { cursor: pointer; }
.glitter-overlay {
    position: fixed;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}
.glitter-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.6) 30%, rgba(255,255,255,0) 70%), radial-gradient(circle at 70% 70%, rgba(255,200,60,0.9), rgba(255,120,80,0.7) 35%, rgba(255,0,0,0) 60%);
    transform: translate(-50%, -50%) scale(0.7) rotate(0deg);
    opacity: 0;
    animation: sparkle 900ms forwards ease-out;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.7));
}

@keyframes sparkle {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6) rotate(0deg); }
    60% { opacity: 1; transform: translate(-50%, -80%) scale(1.2) rotate(90deg); }
    100% { opacity: 0; transform: translate(-50%, -140%) scale(1.6) rotate(180deg); }
}


@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Color Picker Styles */
.color-picker-control {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.color-picker-input {
    width: 32px;
    height: 32px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.color-picker-input:hover {
    border-color: var(--accent-color);
}

body.dark-mode .color-picker-input {
    border-color: #30363d;
}

.color-reset-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: var(--text-color);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.color-reset-btn:hover {
    border-color: var(--accent-color);
    background-color: rgba(45, 186, 78, 0.1);
    color: var(--accent-color);
}

body.dark-mode .color-reset-btn {
    border-color: #30363d;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

body.dark-mode .message-author {
    border-top-color: #30363d;
}

.message-date {
    font-weight: 400;
    color: #666;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

body.dark-mode .message-date {
    color: #8b949e;
}

.like-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.2s ease, filter 0.2s ease;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.like-button:hover {
    transform: scale(1.2);
}

.like-button svg {
    width: 24px;
    height: 24px;
    stroke: #ff7b00;
    stroke-width: 2;
    fill: none;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.like-button.liked svg {
    fill: #ff7b00;
    stroke: #ff7b00;
}

.like-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5rem;
    color: #666;
    padding: 40px;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
    margin-top: auto;
}

/* ===== Stats Section ===== */
.stats-section {
    margin-top: 10px;
    margin-bottom: 50px;
    padding: 10px 0 0;
}

.stats-section h2 {
    font-family: 'Kalam', cursive;
    font-size: 2rem;
    margin: 0 0 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

body.dark-mode .stat-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.35);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 14px rgba(0,0,0,0.12);
}

.stat-card .stat-header {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-color);
    opacity: 0.9;
}

.stat-card .stat-value {
    font-size: 2.3rem;
    font-weight: 700;
    font-family: 'Kalam', cursive;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-card .stat-detail {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

body.dark-mode .stat-card .stat-detail {
    color: #9aa1aa;
}

.stat-card.longest {
    border-color: #ffa657;
}

.stat-snippet {
    font-family: 'Kalam', cursive;
    font-size: 1rem;
    background: rgba(0,0,0,0.04);
    padding: 10px 12px;
    border-radius: 8px;
    max-height: 95px;
    overflow: auto;
}

body.dark-mode .stat-snippet {
    background: rgba(255,255,255,0.06);
}

/* Cores aleatórias para a borda superior dos cards (será aplicado via JS ou classes auxiliares se quisermos) */
.card-color-1 { border-top-color: #ff7b72; }
.card-color-2 { border-top-color: #d2a8ff; }
.card-color-3 { border-top-color: #79c0ff; }
.card-color-4 { border-top-color: #ffa657; }

/* Estilos para Gambiarra do Dia */
.daily-gambiarra-section {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.daily-gambiarra-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.daily-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffa657, #ff7b00);
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 166, 87, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

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

.daily-gambiarra-card {
    background: linear-gradient(135deg, #fff9f0, #fffef8);
    border: 3px solid #ffa657;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(255, 166, 87, 0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.daily-gambiarra-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 166, 87, 0.05) 100%);
    border-radius: 12px;
    pointer-events: none;
}

.daily-gambiarra-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 12px 32px rgba(255, 166, 87, 0.25);
    border-color: #ff7b00;
}

.daily-gambiarra-content {
    font-family: 'Kalam', cursive;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.daily-gambiarra-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 166, 87, 0.2);
    position: relative;
    z-index: 1;
}

.daily-gambiarra-author {
    font-weight: 600;
    color: #ff7b00;
    font-size: 0.95rem;
}

.daily-gambiarra-date {
    font-weight: 400;
    color: #999;
    font-size: 0.9rem;
}

/* QR modal and QR button styles */
.qr-button {
    background: #ffffff;
    color: var(--text-color);
    border: 1px solid #e6e6e6;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
}

.qr-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.qr-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.qr-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); }
.qr-dialog { position: relative; background: var(--card-bg); padding: 20px; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,0.35); max-width: 420px; width: 90%; z-index: 1010; }
.qr-close { position: absolute; top: 8px; right: 8px; background: transparent; border: none; font-size: 1.1rem; cursor: pointer; }
.qr-body { display:flex; flex-direction: column; gap: 12px; align-items: center; }
.qr-body img { width: 280px; height: 280px; max-width: 100%; border-radius: 6px; background: white; padding: 8px; }

.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ===== GIF Overlay ===== */
.gif-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none; /* não bloqueia interação com a página */
}

.gif-item {
    position: absolute;
    image-rendering: auto;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
    transition: transform 0.3s ease;
}

.gif-item:hover {
    transform: scale(1.05);
}
