/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6b35;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #2d3748;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Converter Section */
.converter-section {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.text-input,
.text-output {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease-in-out;
}

.text-input:focus,
.text-output:focus {
    outline: none !important;
    border-color: #ff6b35;
}

.text-output {
    background-color: #f9fafb;
    color: #374151;
}

.input-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

/* Result Section */
.result-section {
    margin-bottom: 2rem;
}

.output-group {
    position: relative;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.output-label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

#char-count {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Info Section */
.info-section {
    margin-top: 2rem;
}

.info-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 2rem;
    border-left: 4px solid #667eea;
}

.info-card h2 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-card h3 {
    color: #374151;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.info-card p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.info-card li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Footer */
.footer {
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
    margin-top: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .output-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .result-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .text-input,
    .text-output {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .info-card {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    .main-content {
        box-shadow: none;
    }
    
    .action-buttons,
    .output-actions,
    .footer {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .text-input,
    .text-output {
        border-width: 3px;
    }
    
    .btn-outline {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .logo-icon {
        animation: none;
    }
}

/* Focus Visible */
.btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.text-input:focus-visible,
.text-output:focus-visible {
    outline: none !important;
}