/* File 3 of 8: css/style.css - COMPLETE WITH BADGE STYLES */
:root {
    --primary: #4a90e2;
    --primary-dark: #357abd;
    --bg: #f4f7f6;
    --text: #333;
    --white: #ffffff;
    --gray: #95a5a6;
    --light-gray: #eee;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 10px;
    text-align: center;
    touch-action: manipulation;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: var(--primary);
    margin: 10px 0 20px 0;
    font-size: 28px;
}

h2 {
    color: var(--primary);
    margin: 15px 0 10px 0;
    font-size: 22px;
}

.hidden {
    display: none !important;
}

/* Mobile-friendly inputs */
input {
    padding: 15px 20px;
    margin: 10px 0;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #ddd;
    width: 100%;
    max-width: 300px;
    height: 50px;
    -webkit-appearance: none;
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Large touch-friendly buttons */
button {
    padding: 15px 25px;
    margin: 8px 5px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    min-height: 50px;
    min-width: 120px;
    touch-action: manipulation;
    transition: background 0.2s, transform 0.1s;
}

button:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

button.secondary {
    background: var(--gray);
}

button.secondary:active {
    background: #7f8c8d;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tool Grid - Mobile First */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

@media (min-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    background: var(--light-gray);
    padding: 25px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: 2px solid transparent;
}

.tool-card:active {
    background: #d0d0d0;
    border-color: var(--primary);
    transform: scale(0.98);
}

.tool-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.tool-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Word Cloud Container */
#cloud-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    min-height: 200px;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
}

/* Word Cloud Words - Enhanced Styling */
.cloud-word {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px;
    background: rgba(74, 144, 226, 0.08);
    border-radius: 20px;
    cursor: default;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.cloud-word:hover {
    transform: scale(1.05);
    z-index: 10;
}

.cloud-word:active {
    transform: scale(0.95);
}

/* Count Badge - Shows exact number */
.count-badge {
    display: inline-block;
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 11px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 5;
}

/* Hot Indicator Emoji */
.hot-indicator {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
    animation: pulse 1.5s infinite;
}

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

/* Satisfaction - Large emoji buttons */
.emoji-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0;
}

.emoji-btn {
    font-size: 50px;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    margin: 5px;
    min-width: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 10px;
}

.emoji-btn:active {
    transform: scale(0.9);
    border-color: var(--primary);
    background: #eef;
}

.stats-box {
    font-size: 32px;
    margin: 20px 0;
    font-weight: bold;
    color: var(--primary);
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
}

/* Admin Section */
#admin-pass {
    max-width: 300px;
}

/* Utility */
.screen {
    animation: fadeInScreen 0.3s ease;
}

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

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

/* Landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 15px;
    }
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .emoji-btn {
        min-width: 60px;
        min-height: 60px;
        font-size: 40px;
    }
}

/* Small mobile screens */
@media (max-width: 360px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    button {
        min-height: 45px;
        padding: 12px 20px;
        font-size: 14px;
    }
    .emoji-btn {
        min-width: 60px;
        min-height: 60px;
        font-size: 40px;
    }
    .count-badge {
        min-width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
    }
}

/* Tablet and larger */
@media (min-width: 768px) {
    .container {
        padding: 30px;
    }
    .tool-grid {
        gap: 20px;
    }
}

/* Print styles */
@media print {
    .container {
        box-shadow: none;
        padding: 0;
    }
    button, .tool-card, #cloud-container {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a2e;
        --text: #eee;
        --white: #16213e;
        --light-gray: #0f3460;
    }
    body {
        background: var(--bg);
    }
    .container {
        background: var(--white);
    }
    input {
        background: #0f3460;
        color: #eee;
        border-color: #333;
    }
}

/* Accessibility - Focus states */
button:focus, input:focus, .tool-card:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}