/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-hover);
}

.card h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.8rem;
}

.description {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.char-count {
    text-align: right;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.segment-preview {
    color: var(--primary-color);
    font-weight: 600;
}

/* Emoji Picker */
.emoji-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.emoji-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.emoji-picker {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-hover);
    position: relative;
    max-height: 300px;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
}

.emoji-picker-header::-webkit-scrollbar {
    height: 4px;
}

.emoji-category {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: var(--bg-color);
}

.emoji-category:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.emoji-category.active {
    background: var(--primary-color);
    color: white;
}

.emoji-picker-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
}

.emoji-item {
    font-size: 1.8rem;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: var(--bg-color);
    transform: scale(1.2);
}

.emoji-item:active {
    transform: scale(1.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* Results */
.results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

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

.results h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.result-item {
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    grid-column: 1 / -1;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.result-item.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.result-item.highlight .result-value {
    color: white;
    font-size: 2rem;
}

/* Current Settings */
.current-settings {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
}

.current-settings h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.settings-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.setting-label {
    font-weight: 600;
    color: var(--text-color);
}

.setting-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Messages */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Loading State */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-item.highlight {
        grid-column: 1;
    }
}

