/* Modern Apple-style CSS */
:root {
    --primary-color: #007AFF;
    --background-color: #F5F5F7;
    --text-color: #1D1D1F;
    --border-radius: 12px;
    --toolbar-bg: #f8f9fa;
    --border-color: #e0e0e0;
}

body {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.formatter-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.input-section, .preview-section {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.text-container-base {
    width: 100%;
    min-height: 200px;
    /* max-height: 500px; */
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    background: white;
}

textarea {
    composes: text-container-base;
    resize: none;
    margin: 0;
}

.preview-box {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    background: white;
    margin: 0;
    max-width: 100%;
}

.formatting-options {
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

.copy-button {
    margin-top: 30px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    padding: 14px 24px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .formatter-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
} 

/* Emoji Picker Styles */
.emoji-picker {
    position: fixed;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.emoji-picker.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.emoji-picker input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.emoji-categories {
    padding: 12px;
}

.emoji-category {
    margin-bottom: 16px;
}

.emoji-category h3 {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.emoji-item {
    cursor: pointer;
    padding: 6px;
    text-align: center;
    font-size: 20px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.emoji-item:hover {
    background-color: var(--background-color);
}

/* Active state for emoji button */
.button-active {
    background-color: #005BD1;
} 

/* New Toolbar Styles */
.toolbar {
    position: relative;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--toolbar-bg);
    border-radius: var(--border-radius);
    z-index: 10;
}

.toolbar-group {
    position: relative;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.toolbar button {
    padding: 8px;
    min-width: 36px;
    height: 36px;
    background: transparent;
    color: var(--text-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar button:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.toolbar button.active {
    background: rgba(0, 0, 0, 0.1);
}

.icon {
    font-style: normal;
    font-size: 18px;
    line-height: 1;
}

/* Adjust container spacing */
.formatter-container {
    margin-top: 20px;
}

/* Make copy button more prominent */
.copy-button {
    margin-top: 20px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    display: block;
} 

/* Update emoji search functionality */
.emoji-category.hidden {
    display: none;
} 

/* Add styles for skin tone selector */
.skin-tone-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.skin-tone-selector span {
    font-size: 14px;
    color: #666;
}

.skin-tone-selector select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
}

/* Update emoji grid for better display */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.emoji-category {
    margin-bottom: 16px;
}

.emoji-category:last-child {
    margin-bottom: 0;
} 

/* Ensure the picker doesn't go off-screen on mobile */
@media (max-width: 768px) {
    .emoji-picker {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        max-height: 80vh;
    }
} 

/* Update input and preview section styles */
.input-section, .preview-section {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Update textarea styles */
textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    /* max-height: 500px; */
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
}

/* Update preview box to match textarea */
.preview-box {
    width: 100%;
    height: 100%;
    min-height: 200px;
    /* max-height: 500px; */
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    background: white;
    margin: 0;
}

/* Update section headings */
.input-section h2, .preview-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
} 

/* Add styles for text counter */
.text-counter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    width: 100%;
    box-sizing: border-box;
}

.text-counter span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add styles for social media icons */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.social-media-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--toolbar-bg);
    color: var(--primary-color);
}

.social-icon.active {
    color: var(--primary-color);
    background: var(--toolbar-bg);
}

/* Add styles for limit indicator */
.preview-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.limit-indicator {
    position: absolute;
    right: 15px;
    color: var(--primary-color);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    background: rgba(0, 122, 255, 0.1);
    display: none;
}

.limit-indicator.visible {
    display: block;
} 

/* Scrollbar styling for consistency */
textarea::-webkit-scrollbar,
.preview-box::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track,
.preview-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb,
.preview-box::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover,
.preview-box::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 

/* Ad Section */
.ad-section {
    padding: clamp(12px, 3vw, 24px);
    margin: clamp(16px, 4vw, 32px) 0;
    background: var(--card-background);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.ad-container {
    max-width: 728px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: var(--hover-background);
    border: 2px dashed rgba(89, 99, 95, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.ad-placeholder span {
    color: var(--text-color);
    font-size: 14px;
    opacity: 0.8;
}

.ad-placeholder div {
    color: var(--text-color);
    font-size: 14px;
    opacity: 0.8;
}

.ad-placeholder a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.ad-placeholder a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Mobile responsiveness for ad section */
@media (max-width: 768px) {
    .ad-section {
        padding: 16px;
        margin: 16px 0;
    }

    .ad-placeholder {
        height: auto;
        min-height: 90px;
        padding: 12px;
    }

    .ad-placeholder span,
    .ad-placeholder div {
        font-size: 12px;
        text-align: center;
    }
}

/* Dark mode support for ad section */
@media (prefers-color-scheme: dark) {
    .ad-placeholder {
        border-color: rgba(76, 215, 165, 0.1);
    }
}

/* Footer Styles */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-button {
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--card-background);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    font-size: 16px;
}

.footer-button .button-icon {
    display: inline-block;
}

.footer-button .button-text {
    display: none;
    white-space: nowrap;
}

.footer-button:hover .button-icon {
    display: none;
}

.footer-button:hover .button-text {
    display: inline-block;
}

.footer-button:hover {
    background: var(--hover-background);
    transform: translateY(-1px);
}

.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 1;
}

.footer-separator {
    color: var(--border-color);
    margin: 0 8px;
}

.app-logo {
    color: var(--text-color);
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.app-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        text-align: center;
    }

    .footer-left, .footer-center, .footer-right {
        width: 100%;
        justify-content: center;
    }

    /* Enhanced mobile toolbar */
    .toolbar {
        padding: 8px;
        gap: 6px;
    }

    .toolbar-group {
        gap: 3px;
    }

    .toolbar button {
        padding: 6px;
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Enhanced text counter for mobile */
    .text-counter {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .toolbar {
        padding: 6px;
        gap: 4px;
    }

    .toolbar button {
        padding: 5px;
        min-width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .text-counter {
        font-size: 13px;
    }

    h1 {
        font-size: 2rem;
    }

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

/* Ensure all content is properly contained */
* {
    max-width: 100%;
    box-sizing: border-box;
} 

/* Language Selector Styles */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

@media (max-width: 768px) {
    .language-selector {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        display: flex;
        justify-content: flex-end;
    }
} 

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--background-color);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

.close:hover {
    color: var(--accent-color);
}

.about-content {
    padding: 20px;
}

.about-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    text-align: center;
}

.about-content section {
    margin-bottom: 30px;
}

.about-content h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.about-content p {
    line-height: 1.6;
    color: var(--text-color);
}

.about-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 90%;
        padding: 15px;
    }

    .about-content {
        padding: 10px;
    }
} 