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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

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

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

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    background: #f8f9fa;
}

.mode-btn {
    padding: 12px 30px;
    border: none;
    background: white;
    color: #333;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mode-content {
    display: none;
    padding: 40px;
}

.mode-content.active {
    display: block;
}

.input-section, .output-section, .decode-section {
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.encoding-options {
    margin: 15px 0;
}

.encoding-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
}

.encoding-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-btn, .copy-btn, .download-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    flex: 1;
}

.encode-btn {
    background: #4CAF50;
    color: white;
}

.decode-btn {
    background: #2196F3;
    color: white;
}

.copy-btn {
    background: #FF9800;
    color: white;
}

.download-btn {
    background: #9C27B0;
    color: white;
}

.action-btn:hover, .copy-btn:hover, .download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.icon {
    font-size: 1.2rem;
}

.drop-zone {
    border: 3px dashed #e0e0e0;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.drop-zone.dragover {
    border-color: #667eea;
    background: #f0f0ff;
}

.drop-zone p {
    color: #666;
    margin: 10px 0;
}

.file-label {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    display: none;
}

.file-info.show {
    display: block;
}

.output-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

.info-section {
    background: #f8f9fa;
    padding: 40px;
    border-top: 1px solid #e0e0e0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-card p {
    color: #666;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    header {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .mode-selector {
        flex-wrap: wrap;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}