/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&family=Dancing+Script:wght@400;500;600;700&family=Roboto:wght@300;400;500;700&family=Montserrat:wght@300;400;500;600;700&family=Lobster&family=Pacifico&family=Righteous&family=Fredoka+One&family=Comfortaa:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Font Classes */
.font-poppins { font-family: 'Poppins', sans-serif; }
.font-playfair { font-family: 'Playfair Display', serif; }
.font-dancing { font-family: 'Dancing Script', cursive; }
.font-roboto { font-family: 'Roboto', sans-serif; }
.font-montserrat { font-family: 'Montserrat', sans-serif; }
.font-lobster { font-family: 'Lobster', cursive; }
.font-pacifico { font-family: 'Pacifico', cursive; }
.font-righteous { font-family: 'Righteous', cursive; }
.font-fredoka { font-family: 'Fredoka One', cursive; }
.font-comfortaa { font-family: 'Comfortaa', cursive; }

/* Header */
.header {
    background: #6b46c1;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-icon {
    font-size: 2rem;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.input-container {
    position: relative;
    margin-bottom: 1rem;
}

#textInput {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

#textInput:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.input-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.info-icon {
    font-size: 1rem;
}

.variation-badge {
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #374151;
}

/* Font Selection */
.font-selection {
    margin-top: 1rem;
}

.font-selection h4 {
    margin-bottom: 0.75rem;
    color: #374151;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.font-btn {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.font-btn:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.font-btn.active {
    border-color: #8b5cf6;
    background: #8b5cf6;
    color: white;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-state {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #374151;
    font-family: 'Poppins', sans-serif;
}

.empty-state p {
    color: #6b7280;
}

/* Decoration Cards */
.decoration-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.decoration-card:hover {
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-icon {
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    font-family: 'Poppins', sans-serif;
}

.card-badge {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.decoration-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.decoration-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    group: true;
}

.decoration-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.decoration-text {
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
    word-break: break-all;
    direction: auto;
    letter-spacing: 0.5px;
    /* Default font will be applied via JavaScript */
}

.copy-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 1.1rem;
}

.decoration-item:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.emoji-palette {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.palette-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.palette-icon {
    font-size: 1.2rem;
}

.palette-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    font-family: 'Poppins', sans-serif;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.tab-btn:hover {
    background: #f3f4f6;
}

.tab-btn.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* Emoji Grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 24rem;
    overflow-y: auto;
}

.emoji-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.emoji-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.1);
}

.palette-tip {
    background: rgba(139, 92, 246, 0.1);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #7c3aed;
}

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        order: -1;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header-icon {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .emoji-grid {
        max-height: 12rem;
    }
    
    .category-tabs {
        justify-content: center;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        top: 1rem;
    }
    
    .font-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .decoration-text {
        font-size: 1.1rem;
    }
}

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

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

.decoration-card {
    animation: fadeIn 0.3s ease;
}

.decoration-text {
    transition: all 0.3s ease;
}

.decoration-text:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Scrollbar Styling */
.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Special font effects */
.font-dancing .decoration-text {
    font-size: 1.4rem;
    line-height: 1.2;
}

.font-lobster .decoration-text {
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.font-pacifico .decoration-text {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.font-fredoka .decoration-text {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.font-playfair .decoration-text {
    font-size: 1.3rem;
    letter-spacing: 0.3px;
}