/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007acc;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --hover-color: #f0f0f0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-radius: 8px;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

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

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-emoji {
    font-size: 1.5rem;
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.search-input.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23999' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 3rem;
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-btn:hover {
    background: var(--hover-color);
}

/* Main content */
.main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Categories */
.emoji-categories {
    margin-bottom: 3rem;
}

.emoji-categories h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    background: #fff;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.category-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.category-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.category-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Emoji grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.emoji-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    text-align: center;
}

.emoji-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.emoji-char {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.emoji-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.emoji-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.emoji-version {
    background: var(--secondary-color);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.emoji-subgroup {
    font-size: 0.7rem;
}

/* Popular emojis section */
.popular-emojis {
    margin-bottom: 3rem;
}

.popular-emojis h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Search results */
.search-results h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 2rem 0;
    grid-column: 1 / -1;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

/* Category header */
.category-header {
    margin-bottom: 2rem;
    text-align: center;
}

.category-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Emoji detail page */
.emoji-detail {
    max-width: 800px;
    margin: 0 auto;
}

.emoji-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--secondary-color);
}

.emoji-large {
    font-size: 6rem;
    line-height: 1;
    cursor: pointer;
}

.emoji-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.copy-btn-large {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.copy-btn-large:hover {
    background: #0056b3;
}

.emoji-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.detail-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.detail-list {
    display: grid;
    gap: 1rem;
}

.detail-list dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-list dd {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.detail-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-list a:hover {
    text-decoration: underline;
}

.copy-options {
    display: grid;
    gap: 0.5rem;
}

.copy-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-option:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.copy-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.copy-value {
    font-family: monospace;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-search {
        max-width: none;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .emoji-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .emoji-large {
        font-size: 4rem;
    }
    
    .emoji-details {
        grid-template-columns: 1fr;
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .emoji-item {
        padding: 1rem 0.5rem;
    }
    
    .emoji-char {
        font-size: 2rem;
    }
}
