* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    padding: 40px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 8px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector label {
    font-weight: 600;
    color: #333;
}

.model-selector select {
    padding: 8px 16px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.model-selector select:hover {
    border-color: #764ba2;
}

.model-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.token-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.count-label {
    font-weight: 600;
    color: #333;
}

.count-value {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    min-width: 60px;
    text-align: center;
}

.tokenizer-area {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .tokenizer-area {
        grid-template-columns: 1fr;
    }
}

.input-section,
.emoji-section,
.output-section {
    display: flex;
    flex-direction: column;
}

.input-section label,
.emoji-section label,
.output-section label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1rem;
}

#textInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.token-display,
.emoji-display {
    min-height: 250px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    overflow-y: auto;
    max-height: 400px;
}

.emoji-display {
    background: #fff9e6;
    border-color: #ffd700;
}

.placeholder {
    color: #999;
    font-style: italic;
}

.token {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    white-space: pre;
    transition: transform 0.2s ease;
    cursor: default;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.token:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Different colors for tokens */
.token:nth-child(8n+1) { background-color: #FFE5E5; }
.token:nth-child(8n+2) { background-color: #E5F3FF; }
.token:nth-child(8n+3) { background-color: #FFF4E5; }
.token:nth-child(8n+4) { background-color: #E5FFE5; }
.token:nth-child(8n+5) { background-color: #FFE5FF; }
.token:nth-child(8n+6) { background-color: #FFFFE5; }
.token:nth-child(8n+7) { background-color: #E5FFFF; }
.token:nth-child(8n+8) { background-color: #F0E5FF; }

.emoji-token {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.2rem;
    white-space: pre;
    transition: transform 0.2s ease;
    cursor: default;
    background: #fff;
    border: 2px solid #ffd700;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2);
}

.emoji-token:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
}

.info-panel {
    background: #f7f7f7;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.info-panel p {
    margin-bottom: 15px;
    color: #555;
}

.info-panel ul {
    list-style-position: inside;
    color: #555;
}

.info-panel ul li {
    margin-bottom: 8px;
}

footer {
    background: #f7f7f7;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}
