/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #2563eb;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Converter Section */
.converter-section {
    padding: 4rem 0;
    background: white;
}

.converter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.input-section, .result-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
}

.input-header, .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-header h2, .result-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Input Mode Selector */
.input-mode-selector {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 8px;
    padding: 0.25rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #64748b;
}

.mode-btn.active {
    background: #2563eb;
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #e2e8f0;
}

/* Input Container */
.input-container {
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 200px;
    transition: border-color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #2563eb;
    background: #f0f9ff;
}

.file-upload-content i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.file-upload-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.file-upload-content p {
    color: #64748b;
    font-size: 0.875rem;
}

/* File Info */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-details i {
    font-size: 1.5rem;
    color: #2563eb;
}

.file-text {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #1e293b;
}

.file-size {
    font-size: 0.875rem;
    color: #64748b;
}

.remove-file-btn {
    padding: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-file-btn:hover {
    background: #dc2626;
}

/* Operation Selector */
.operation-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 8px;
    padding: 0.25rem;
}

.operation-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: #64748b;
}

.operation-btn.active {
    background: #10b981;
    color: white;
}

.operation-btn:hover:not(.active) {
    background: #e2e8f0;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-btn, .download-btn, .clear-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

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

.download-btn {
    background: #2563eb;
    color: white;
}

.download-btn:hover {
    background: #1d4ed8;
}

.clear-btn {
    background: #ef4444;
    color: white;
}

.clear-btn:hover {
    background: #dc2626;
}

/* Result Output */
.result-output {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.result-output.has-result {
    border-color: #10b981;
    background: #f0fdf4;
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #9ca3af;
    text-align: center;
}

.result-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-placeholder p {
    font-size: 1rem;
}

.result-text {
    color: #166534;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.result-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.result-file i {
    font-size: 2rem;
    color: #2563eb;
}

.file-result-info {
    flex: 1;
}

.file-result-info .file-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.file-result-info .file-status {
    font-size: 0.875rem;
    color: #10b981;
}

/* Result Info */
.result-info {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

/* Examples Section */
.examples-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.examples-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.example-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.example-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.example-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.example-text {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #2563eb;
    background: #f0f9ff;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.example-base64 {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #10b981;
    background: #f0fdf4;
    padding: 0.75rem;
    border-radius: 6px;
    word-break: break-all;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

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

.feature-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-card i {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    padding: 4rem 0;
    background: #f8fafc;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

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

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.step p {
    color: #64748b;
    line-height: 1.6;
}

/* FAQ Section */
.faq {
    padding: 4rem 0;
    background: white;
}

.faq h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #e2e8f0;
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.faq-question i {
    color: #64748b;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: #64748b;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #f1f5f9;
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1rem;
    text-align: center;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .converter-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .input-mode-selector {
        flex-direction: column;
    }
    
    .operation-selector {
        flex-direction: column;
    }
    
    .result-actions {
        flex-wrap: wrap;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .converter-section {
        padding: 2rem 0;
    }
    
    .features,
    .how-it-works,
    .faq {
        padding: 2rem 0;
    }
    
    .features h2,
    .how-it-works h2,
    .faq h2 {
        font-size: 2rem;
    }
    
    .input-header,
    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .result-actions {
        justify-content: center;
    }
    
    .file-info {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .file-details {
        justify-content: center;
    }
}

/* Animation for result display */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-output.has-result {
    animation: fadeIn 0.3s ease-out;
}

/* Custom scrollbar for result text */
.result-text::-webkit-scrollbar {
    width: 6px;
}

.result-text::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.result-text::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.result-text::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

