@charset "UTF-8";

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding-top: 40px; /* Space for fixed header */
}

.main-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0px 20px 20px 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 20px;
}

.tool-title {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--font-color);
    margin-bottom: 10px;
}

.tool-subtitle {
    font-size: 1.2em;
    color: var(--font-color);
    opacity: 0.8;
    margin: 0;
}

.tool-content {
    background: var(--content-bg-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}


/* Enhanced tool info banner */
.tool-info-banner {
    display: flex;
    align-items: center;
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-info-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.info-icon {
    font-size: 24px;
    margin-right: 15px;
    color: #4CAF50;
}

.info-content {
    flex: 1;
}

.info-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #2e7d32;
}

.info-description {
    margin: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.4;
}

.info-description strong {
    font-weight: 600;
    color: #1b5e20;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

#base64Input {
    width: 100%;
    min-height: 150px;
    max-height: 300px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
    background: var(--alt-content-bg-color, #fff);
    color: var(--font-color);
    box-sizing: border-box;
    word-break: break-all;
    transition: border-color 0.3s ease;
}

#base64Input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#base64Input::placeholder {
    color: #999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

.input-help {
    margin-top: 15px;
    padding: 15px;
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.input-help p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--font-color);
}

.input-help ul {
    margin: 0;
    padding-left: 20px;
}

.input-help li {
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--font-color);
    opacity: 0.8;
}

.input-help strong {
    color: var(--font-color);
    opacity: 1;
}

/* Error Section */
.error-section {
    margin-bottom: 30px;
}

.error-message {
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message::before {
    content: '⚠️';
    font-size: 16px;
}

/* Preview Section */
.preview-section {
    margin-bottom: 30px;
}

.preview-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.preview-container {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    background: var(--alt-content-bg-color, #fff);
    text-align: center;
}

#previewImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-info {
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.image-info span {
    display: block;
    font-size: 0.9em;
    color: var(--font-color);
    opacity: 0.8;
    margin-bottom: 5px;
    line-height: 1.4;
}

.image-info span:last-child {
    margin-bottom: 0;
}

.download-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.download-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.download-btn.downloaded {
    background: #28a745;
}

.download-btn::before {
    content: '⬇️';
    font-size: 16px;
}

.clear-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Dark Mode Adaptations */
body.dark-mode .tool-content {
    background: var(--content-bg-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

body.dark-mode #base64Input {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-color: #555;
    color: var(--font-color);
}

body.dark-mode #base64Input::placeholder {
    color: #777;
}

body.dark-mode .input-help {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-left-color: #4CAF50;
}

body.dark-mode .preview-container {
    border-color: #555;
    background: var(--alt-content-bg-color, #2d2d2d);
}

body.dark-mode .image-info {
    border-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 2em;
    }
    
    #base64Input {
        font-size: 11px;
        min-height: 120px;
    }
    
    .download-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .download-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-help {
        padding: 12px;
    }
    
    .preview-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .input-help ul {
        padding-left: 15px;
    }
    
    .input-help li {
        font-size: 13px;
    }
}