@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;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 10px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--alt-content-bg-color, #f8f9fa);
    position: relative;
}

.dropzone:hover {
    border-color: #4CAF50;
    background: var(--alt-content-bg-color, #f0f8f0);
}

.dropzone.dragover {
    border-color: #4CAF50;
    background: var(--alt-content-bg-color, #e8f5e8);
    transform: scale(1.02);
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.6;
}

.dropzone-text {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--font-color);
    margin-bottom: 8px;
}

.dropzone-subtext {
    font-size: 0.9em;
    color: var(--font-color);
    opacity: 0.7;
    margin-bottom: 20px;
}

.browse-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;
    pointer-events: auto;
}

.browse-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Image Preview Section */
.image-preview {
    border: 2px solid #ddd;
    border-radius: 12px;
    background: var(--alt-content-bg-color, #fff);
    overflow: hidden;
}

.preview-container {
    padding: 20px;
    text-align: center;
}

#previewImage {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-info {
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.image-info span {
    font-size: 0.9em;
    color: var(--font-color);
    opacity: 0.8;
    display: block;
    line-height: 1.4;
}

/* Reset button styling - identical to imgresizer */
.reset-container {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    display: none; /* Initially hidden */
}

.reset-link {
    color: var(--font-color);
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px dashed #CCC;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s;
}

.reset-link:hover {
    color: #4CAF50;
    border-color: #4CAF50;
    background-color: var(--alt-content-bg-color);
}

.reset-link:before {
    content: "↺ ";
    display: inline-block;
    margin-right: 5px;
}

/* Output Section */
.output-section {
    margin-bottom: 30px;
}

.output-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0px;
    gap: 20px;
}

.output-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.format-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--font-color);
    white-space: nowrap;
}

.format-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.format-option input[type="radio"]:checked + .radio-custom {
    border-color: #4CAF50;
}

.format-option input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.format-option:hover .radio-custom {
    border-color: #4CAF50;
}

#base64Output {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    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;
}

#base64Output:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Copy Button */
.copy-btn {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.copy-btn.copied {
    background: #28a745;
}

/* Error Message */
.error-message {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 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 .dropzone {
    border-color: var(--border-color);
    background: var(--alt-content-bg-color, #2d2d2d);
}

body.dark-mode .dropzone:hover {
    border-color: #4CAF50;
    background: var(--alt-content-bg-color, #354535);
}

body.dark-mode .dropzone.dragover {
    background: var(--alt-content-bg-color, #3d4a3d);
}

body.dark-mode .image-preview {
    border-color: var(--border-color);
    background: var(--alt-content-bg-color, #2d2d2d);
}

body.dark-mode .reset-link {
    color: var(--font-color);
    border-color: var(--border-color);
}

body.dark-mode .reset-link:hover {
    color: #4CAF50;
    border-color: #4CAF50;
    background-color: var(--alt-content-bg-color);
}

body.dark-mode .image-info {
    border-color: #555;
}

body.dark-mode .radio-custom {
    border-color: #555;
}

body.dark-mode #base64Output {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 2em;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .output-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropzone {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5em;
    }
    
    #base64Output {
        font-size: 11px;
        min-height: 150px;
    }
    
    .preview-controls {
        padding: 12px 15px;
    }
    
    .preview-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .output-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .copy-btn {
        align-self: stretch;
        text-align: center;
    }
}