/* Custom Styles for SNS Content Generator - Mobile Optimized */

/* Touch-friendly form elements */
.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    touch-action: manipulation;
}

/* Enhanced platform cards for mobile */
.platform-card {
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile-optimized result cards */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    color: white;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .result-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .result-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    }
}

.result-card.instagram {
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
}

.result-card.twitter {
    background: linear-gradient(135deg, #1DA1F2 0%, #0e71c4 100%);
}

.result-card.tiktok {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

.result-card.threads {
    background: linear-gradient(135deg, #000000 0%, #434343 100%);
}

/* Mobile-optimized copy button */
.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS touch target minimum */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .copy-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.copy-btn:hover, .copy-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

.copy-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Mobile-friendly hashtags */
.hashtag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    margin: 0.125rem;
    display: inline-block;
    word-break: break-word;
}

@media (min-width: 640px) {
    .hashtag {
        font-size: 0.875rem;
    }
}

/* Mobile-optimized tip items */
.tip-item {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .tip-item {
        font-size: 0.875rem;
    }
}

.upload-area {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

.upload-area.dragover {
    border-color: #8b5cf6;
    background-color: #f3f4f6;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* Animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Enhanced mobile-first responsive design */
@media (max-width: 475px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .result-card {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    /* Ensure single column on very small screens */
    .xs\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    /* Improve readability on mobile */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-text-size-adjust: 100%;
    }
    
    /* Better spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
}

/* Mobile-first toast notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
    max-width: calc(100vw - 40px);
    text-align: center;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .toast {
        top: 20px;
        right: 20px;
        left: auto;
        transform: translateX(100%);
        max-width: 400px;
        text-align: left;
    }
    
    .toast.show {
        transform: translateX(0);
    }
}

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

@media (min-width: 640px) {
    .toast.show {
        transform: translateX(0);
    }
}

.toast.error {
    background: #ef4444;
}

/* Touch-friendly improvements */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
input:focus, textarea:focus, button:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Prevent horizontal scroll */
.overflow-x-hidden {
    overflow-x: hidden;
}

/* Optimize text selection */
.result-card .content-text {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Language-specific font optimizations */
/* 언어별 폰트 최적화 */

/* Japanese text optimization */
:lang(ja) {
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

/* Chinese text optimization */
:lang(zh) {
    font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Thai text optimization */
:lang(th) {
    font-family: "Noto Sans Thai", "Sukhumvit Set", "Helvetica Neue", sans-serif;
    line-height: 1.8;
    letter-spacing: 0.03em;
}

/* Language selector styles */
#languageDropdown {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#languageDropdown button:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* Multi-language text display */
.multilingual-text {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Responsive text sizing for different languages */
@media (max-width: 640px) {
    :lang(th) {
        line-height: 1.9;
    }
    
    :lang(zh) {
        font-size: 0.95em;
    }
    
    :lang(ja) {
        font-size: 0.95em;
    }
}

/* Language-specific character density adjustments */
:lang(zh) .result-card .content-text,
:lang(ja) .result-card .content-text {
    padding: 1rem;
    line-height: 1.8;
}

:lang(th) .result-card .content-text {
    padding: 1rem;
    line-height: 1.9;
}

/* Improved readability for Asian languages */
:lang(zh) .hashtag,
:lang(ja) .hashtag,
:lang(th) .hashtag {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* Language flag styles */
.language-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    font-family: 'Arial', sans-serif;
    letter-spacing: -0.5px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Language selector animation */
#languageSelector {
    transition: all 0.2s ease;
}

#languageSelector:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#languageDropdown {
    animation: dropdownFadeIn 0.2s ease-out;
}

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

/* Language dropdown item hover effects */
#languageDropdown button:hover .language-flag {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}