* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.upload-area {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 3px dashed #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.upload-area.drag-over {
    background: #f0f4ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.upload-content p {
    color: #666;
    margin: 10px 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin: 20px 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.file-info {
    font-size: 0.9rem;
    color: #999;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #eee;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.base64-size {
    color: #667eea;
    font-size: 0.85rem;
    margin-top: 3px;
}

.base64-output {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: #495057;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-copy {
    background: #667eea;
    color: white;
    flex: 1;
}

.btn-copy:hover {
    background: #5568d3;
}

.btn-copy.copied {
    background: #10b981;
}

.btn-download {
    background: #764ba2;
    color: white;
    flex: 1;
}

.btn-download:hover {
    background: #653a8a;
}

.btn-remove {
    background: #ef4444;
    color: white;
}

.btn-remove:hover {
    background: #dc2626;
}

.processing {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 1.1rem;
}

.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .results {
        grid-template-columns: 1fr;
    }
}
