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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #ff6b6b;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tab-container {
    background: white;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
    border-radius: 10px 10px 0 0;
}

.tab-btn.active {
    background: #ff6b6b;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #f5f5f5;
}

.tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

.converter-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.encode-section, .decode-section {
    padding: 1.5rem;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
}

.encode-section h3, .decode-section h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
    margin-bottom: 1rem;
}

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

textarea[readonly] {
    background: #f8f9fa;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.primary-btn, .secondary-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.primary-btn {
    background: #ff6b6b;
    color: white;
}

.primary-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.secondary-btn {
    background: #f5f5f5;
    color: #666;
}

.secondary-btn:hover {
    background: #e0e0e0;
}

.output-container {
    position: relative;
}

.output-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.copy-btn {
    position: absolute;
    top: 2rem;
    right: 1rem;
    background: #ff9a9e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #ff6b6b;
}

.copy-btn.copied {
    background: #4caf50;
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 0.5rem;
    min-height: 20px;
}

.file-converter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.file-upload, .decode-file {
    padding: 1.5rem;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
}

.file-upload h3, .decode-file h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.drop-zone {
    border: 2px dashed #ff9a9e;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.drop-zone:hover, .drop-zone.dragover {
    background: #fff5f5;
    border-color: #ff6b6b;
}

.drop-zone input[type="file"] {
    display: none;
}

.file-details {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.file-details p {
    margin-bottom: 0.5rem;
}

#filename-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    margin-right: 1rem;
}

.features {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.features h3 {
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-item p {
    color: #666;
    line-height: 1.5;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.ad-area {
    background: #f0f0f0;
    padding: 2rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 2px dashed #ccc;
}

@media (max-width: 768px) {
    .converter-section, .file-converter {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
    }
}