body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.main-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-section {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.container {
    width: 90%;
    max-width: 800px;
}

.tool-container {
    background-color: #fff;
}

.content-section {
    padding: 3rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1877f2;
    text-align: center;
}

.subheadline {
    text-align: center;
    font-size: 1.1rem;
    color: #606770;
    margin-bottom: 2rem;
}

h2 {
    color: #1c1e21;
    margin-bottom: 1rem;
}

h3 {
    color: #1877f2;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #4b4f56;
}

/* Tool Styles */
.options {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.formatting-toolbar-wrapper {
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.formatting-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.format-btn {
    background-color: #fff;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    padding: 0.8rem; /* Increased padding for better touch targets */
    min-width: 44px; /* Minimum touch target size */
    min-height: 44px; /* Minimum touch target size */
    cursor: pointer;
    font-size: 1rem;
    color: #1c1e21;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.format-btn:hover {
    background-color: #f0f2f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.format-btn:active {
    background-color: #e4e6eb;
    transform: translateY(0);
    box-shadow: none;
}

.format-btn.active {
    background-color: #1877f2;
    color: #fff;
    border-color: #1877f2;
}

/* Emoji Picker Styles */
.emoji-picker {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background-color: #fff;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    z-index: 1000;
    max-width: 400px;
    width: 100%;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-search-container {
    margin-bottom: 1rem;
}

.emoji-search {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dddfe2;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
    min-height: 44px; /* Mobile friendly input */
}

.emoji-search:focus {
    outline: none;
    border-color: #1877f2;
}

.emoji-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dddfe2;
    flex-wrap: wrap;
}

.emoji-category-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    min-width: 44px; /* Minimum touch target size */
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-category-btn:hover {
    background-color: #f0f2f5;
}

.emoji-category-btn.active {
    background-color: #e4e6eb;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.emoji-item {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none;
    min-width: 44px; /* Minimum touch target size */
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background-color: #f0f2f5;
}

/* Text Areas */
.textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    font-size: 1.1rem;
    min-height: 150px;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    margin-bottom: 1rem;
    font-family: inherit;
}

#input {
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.output-container {
    display: flex;
    flex-direction: column;
}

#output {
    background-color: #f8f9fa;
    color: #1c1e21;
}

#copy {
    align-self: flex-end;
    background-color: #1877f2;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem; /* Increased padding */
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

#copy:hover {
    background-color: #166fe5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

#copy:active {
    transform: translateY(0);
    box-shadow: none;
}

#copy:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.4);
}

.note {
    font-size: 0.85rem;
    color: #90949c;
    margin-top: 1rem;
    font-style: italic;
}

/* Content Section Styles */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-color: #1877f2;
    color: white;
    border-radius: 50%;
    line-height: 30px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.platform-list {
    display: grid;
    gap: 0.8rem;
}

.platform-item {
    background: #fff;
    padding: 0.8rem;
    border-radius: 6px;
    border-left: 4px solid #1877f2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

footer {
    background-color: #fff;
    width: 100%;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid #dddfe2;
    text-align: center;
    display: flex;
    justify-content: center;
}

footer .container {
    max-width: none;
    width: auto;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    color: #606770;
}

.footer-links a,
.footer-links span {
    color: #606770;
    text-decoration: none;
    padding: 0.5rem; /* Better touch targets for links */
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1c1e21;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #42b883;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Character Count */
.output-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.char-count {
    font-size: 0.85rem;
    color: #90949c;
    transition: color 0.2s;
}

.char-count.warning {
    color: #f5a623;
}

.char-count.danger {
    color: #e74c3c;
}

/* Enhanced Focus States */
.format-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.4);
}

.emoji-search:focus-visible {
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2);
}

#input:empty::before {
    content: attr(placeholder);
    color: #90949c;
    pointer-events: none;
}

/* Emoji Item Focus State for Keyboard Navigation */
.emoji-item:focus {
    outline: none;
    background-color: #e4e6eb;
    box-shadow: 0 0 0 2px #1877f2;
}

.emoji-item.selected {
    background-color: #e4e6eb;
    box-shadow: 0 0 0 2px #1877f2;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .formatting-toolbar {
        justify-content: center;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}