@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: 800px;
    margin: 20px auto;
    padding: 20px;
}

.converter-container {
    background-color: var(--content-bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 25px;
}

h1 {
    margin-top: 0;
    color: var(--font-color);
    text-align: center;
    margin-bottom: 10px;
}

.tool-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Image Preview Area */
.image-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.dropzone {
    width: 95%;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    background-color: var(--alt-content-bg-color);
    color: var(--alt-font-color);
}

.dropzone:hover, .dropzone.dragover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateY(-2px);
    color: var(--font-color);
}

.dropzone p {
    margin: 5px 0;
}

.dropzone p:first-of-type {
    color: var(--font-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.dropzone p:last-of-type {
    color: var(--font-color);
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

.file-input-label {
    background-color: #4CAF50;
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-input-label:hover {
    background-color: #45a049;
}

.preview-box {
    width: 100%;
    max-width: 500px;
    text-align: center;
    display: none; /* Initially hidden */
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Add a reset button to allow users to select a different image */
/* Add this at the end to ensure we have a way to reset and select a new image */
.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;
    background-color: var(--bg-color);
}

.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;
}

/* Conversion Options */
.conversion-options {
    background: var(--content-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 0 30px 10px 30px;
    margin-bottom: 20px;
}

.conversion-options h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    color: var(--font-color);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.option-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--content-bg-color);
    color: var(--font-color);
    transition: all 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.quality-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.quality-container input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.quality-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.quality-value {
    font-weight: 600;
    color: #007bff;
    font-size: 0.9rem;
    min-width: 50px;
}

.color-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.color-container input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-label {
    color: var(--alt-font-color);
    font-size: 0.8rem;
}

.conversion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Reset button styling */
.reset-btn {
    background: transparent;
    color: #007bff;
    border: 2px dashed #007bff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: #0056b3;
    color: #0056b3;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    background: var(--content-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Conversion Result */
.conversion-result {
    background: var(--content-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 0 30px 30px 30px;
    margin-bottom: 20px;
}

.conversion-result h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--alt-content-bg-color);
    border-radius: 8px;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--hover-bg);
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: var(--font-color);
}

.info-value {
    font-family: 'Courier New', monospace;
    color: var(--font-color);
}

.size-decrease {
    color: #28a745;
}

.size-increase {
    color: #dc3545;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: #28a745;
    color: white;
}

.notification.error {
    background: #dc3545;
    color: white;
}

.notification.info {
    background: #17a2b8;
    color: white;
}

/* Privacy/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;
}

[data-theme="dark"] .tool-info-banner {
    background: linear-gradient(135deg, #1a3d1a 0%, #2a4d2a 100%);
    border-color: #4a7c4a;
}

.info-icon {
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-title {
    color: #2e7d32;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

[data-theme="dark"] .info-title {
    color: #66cc66;
}

.info-description {
    color: #4a7c4a;
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
}

[data-theme="dark"] .info-description {
    color: #88aa88;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 2px solid #007bff;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
    border-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108,117,125,0.3);
}

.btn-success {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border: 2px solid #ffc107;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    border-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 2px solid #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

/* Image info section */
.image-info {
    margin-top: 5px;
    text-align: center;
}

.image-dimensions {
    color: var(--font-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.image-details {
    background: var(--hover-bg);
    border-radius: 8px;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
}

.file-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px 0;
}

.file-detail:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--font-color);
    font-size: 0.9rem;
}

.detail-value {
    font-family: 'Courier New', monospace;
    color: var(--font-color);
    font-size: 0.9rem;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

/* Converted Image Preview */
.converted-preview {
    background: var(--alt-content-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 0 25px 10px 25px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.converted-preview h4 {
    color: var(--font-color);
    margin-bottom: 0px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.preview-item h5 {
    color: var(--font-color);
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.comparison-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    object-fit: contain;
}

.preview-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.format-badge {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.format-badge.jpeg {
    background: #ff6b6b;
}

.format-badge.png {
    background: #4ecdc4;
}

.format-badge.webp {
    background: #45b7d1;
}

.format-badge.bmp {
    background: #96ceb4;
}

.format-badge.gif {
    background: #feca57;
    color: #333;
}

.size-info {
    color: var(--font-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Download section within converted preview */
.download-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
}

.download-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 220px;
    margin: 0 auto;
}

.download-section .btn-icon {
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .file-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .detail-value {
        text-align: left;
        max-width: 100%;
        font-size: 0.8rem;
    }
    
    .detail-label {
        font-size: 0.8rem;
    }
    
    .image-details {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .conversion-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .tool-info-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .info-content {
        text-align: center;
    }
    
    .dropzone {
        width: 100%;
        height: 120px;
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .conversion-actions {
        flex-direction: column;
    }
    
    .conversion-actions .btn {
        width: 100%;
    }
    
    .preview-comparison {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .comparison-image {
        max-height: 150px;
    }
    
    .converted-preview {
        padding: 20px;
    }
    
    .download-section .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .tool-info-banner {
        padding: 15px;
    }
    
    .info-title {
        font-size: 1rem;
    }
    
    .info-description {
        font-size: 0.9rem;
    }
    
    .dropzone {
        height: 100px;
        padding: 10px;
    }
    
    .dropzone p:first-of-type {
        font-size: 1rem;
    }
    
    .dropzone p:last-of-type {
        font-size: 0.8rem;
    }
    
    .converted-preview {
        padding: 15px;
    }
    
    .converted-preview h4 {
        font-size: 1.1rem;
    }
    
    .preview-item h5 {
        font-size: 0.9rem;
    }
    
    .comparison-image {
        max-height: 120px;
    }
    
    .format-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .size-info {
        font-size: 0.8rem;
    }
    
    .download-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .download-section .btn {
        font-size: 1rem;
        padding: 12px 24px;
    }
}