:root {
    --primary: #1ba4c8;
    --primary-dark: #1892B2;
    --secondary: #1892B2;
    --light-bg: #F8FCFF;
    --border: #e1e5f1;
    --text: #333;
    --text-light: #666;
    --danger: #ff6b6b;
    --success: #06d6a0;
    --warning: #ffd166;
    --info: #2b2b2b;
    --info-back: #f8f9fa;
    --accent-cyan: #00E5FF;
    --accent-lime: #7CFF00;
    --accent-amber: #FFC107;
}

/* Dark mode styles - only for favicon preview section */
.favicon-preview-section-custom.dark-mode {
    --preview-bg: #1a1a1a;
    --preview-border: #333;
    --preview-text: #e0e0e0;
    --preview-text-light: #aaa;
    --preview-box-bg: #2d2d2d;
    --preview-box-border: #444;
    background-color: var(--preview-bg) !important;
    border-color: var(--preview-border) !important;
}

.favicon-preview-section-custom.dark-mode .section-title-custom {
    color: var(--preview-text) !important;
}

.favicon-preview-section-custom.dark-mode .favicon-preview-label {
    color: var(--preview-text-light) !important;
}

.favicon-preview-section-custom.dark-mode .favicon-preview-box {
    background-color: var(--preview-box-bg) !important;
    border-color: var(--preview-box-border) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3) !important;
}

.favicon-preview-section-custom.dark-mode .favicon-preview-box:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4) !important;
}

/* Dark mode scrollbars for preview section only */
.favicon-preview-section-custom.dark-mode::-webkit-scrollbar-track {
    background: #2d2d2d !important;
}

.favicon-preview-section-custom.dark-mode::-webkit-scrollbar-thumb {
    background: #555 !important;
}

.favicon-preview-section-custom.dark-mode::-webkit-scrollbar-thumb:hover {
    background: #666 !important;
}

/* Main Container */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.container-custom p { text-align: center; }
.container-custom select { margin-bottom: 0; }
.container-custom h3, 
.container-custom h3 a { font-size: 18px !important; padding: 0px; }

/* Content Wrapper */
.content-wrapper-custom {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left Panel - NO SCROLL */
.left-panel-custom {
    flex: 0 0 300px;
    padding: 15px;
    border-right: 1px solid var(--border);
    overflow-y: visible !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    background-color: white;
}

/* Right Panel */
.right-panel-custom {
    flex: 1;
    padding: 15px;
    overflow-y: hidden;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.section-title-custom {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-custom .fa-icon {
    color: var(--primary);
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

/* Upload Area */
.upload-area-custom {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 5px 10px;
    text-align: center;
    background-color: rgb(164 187 200 / 10%);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area-custom:hover {
    background-color: rgb(164 187 200 / 20%);
    border-color: var(--primary-dark);
}

.upload-area-custom i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2px;
}
.upload-area-custom h3 {
    font-size: 1rem;
    color: var(--secondary);
}
.upload-area-custom p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0px;
    text-align: center;
}

#fileInput {
    display: none;
}

/* Form Controls */
.form-group-custom {
    margin-bottom: 2px;
}

/* Quality Slider */
.quality-slider-container-custom, asharpnessContainer {
    margin-top: 2px;
    line-height: 1.1;
}


.quality-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.quality-value-custom {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.quality-description-custom {
    font-size: 0.8rem;
    color: var(--text-light);
}

.quality-slider-custom {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--slider-percent, 20%), #e0e0e0 var(--slider-percent, 20%), #e0e0e0 100%);
    outline: none;
    border-radius: 2.5px;
    margin-bottom: 2px;
}

.quality-slider-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quality-slider-custom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Quality Info Text */
.quality-info-text {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* Quality Presets */
.quality-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.quality-preset-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--light-bg);
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.quality-preset-btn:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-1px);
}

.quality-preset-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Color Picker */
.color-picker-container-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    margin-top: 8px;
}

.color-preview-custom {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.color-preview-custom:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.color-input-custom {
    flex: 1;
    padding: 10px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px  !important;
    font-family: monospace !important;
    font-size: 0.9rem !important;
    outline: none !important;
    transition: all 0.2s !important;
    background: white !important;
    color: var(--text) !important;
}

.color-input-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(27, 164, 200, 0.1);
}

/* Dark Mode Toggle Switch */
.dark-mode-toggle-custom {
    display: flex;
    align-items: center;
}

/* Smaller toggle switch */
.switch-custom {
    position: relative;
    display: inline-block;
    width: 40px; /* Reduced from 50px */
    height: 20px; /* Reduced from 24px */
}

.switch-custom input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-custom {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px; /* Adjusted for smaller size */
}

.slider-custom:before {
    position: absolute;
    content: "";
    height: 14px; /* Reduced from 16px */
    width: 14px; /* Reduced from 16px */
    left: 3px; /* Adjusted for smaller size */
    bottom: 3px; /* Adjusted for smaller size */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-custom {
    background-color: var(--primary);
}

input:checked + .slider-custom:before {
    transform: translateX(20px); /* Adjusted for smaller width */
}

/* Action Buttons */
.action-buttons-custom {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

/* Loading */
.loading-custom {
    display: none;
    text-align: center;
    padding: 8px;
}

.spinner-custom {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preview Area - Cropper Container */
.preview-area-custom {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex: 0 0 400px !important;
    flex-shrink: 0 !important;
    background-color: #f8f9fa;
}

.preview-container-custom {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

#cropImage {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: none;
    margin: auto;
}

/* Crop Coordinates Display */
.crop-coordinates-display {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6) !important;
    color: var(--accent-lime) !important;
    padding: 0px 5px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    z-index: 100;
    display: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Crop box dimensions overlay */
.cropper-crop-box::after {
    content: attr(data-dimensions);
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.6) !important;
    color: var(--accent-cyan) !important;
    padding: 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Cropper.js custom styles */
.cropper-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    touch-action: none;
    user-select: none;
    width: 100% !important;
    height: 100% !important;
}

.cropper-view-box {
    outline: 2px dotted white !important;
    outline-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.cropper-point {
    background-color: white !important;
    border: 2px solid var(--primary) !important;
    opacity: 1 !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.preview-placeholder-custom {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.preview-placeholder-custom .fa-icon {
    font-size: 3rem;
    color: #d1d9f0;
    margin-bottom: 10px;
}

/* Favicon Preview Section */
.favicon-preview-section-custom {
    flex: 1;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Favicon Preview Container */
.favicon-preview-container-custom {
    transition: all 0.3s ease;
}

.favicon-preview-grid-custom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.favicon-preview-item-custom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.favicon-preview-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.favicon-preview-box {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.favicon-preview-box:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.favicon-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* HTML Code Section Styles */
.html-code-section-custom {
    animation: fadeIn 0.3s ease-out;
    background: var(--light-bg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.html-code-container-custom {
    position: relative;
}

.html-code-display-custom {
    position: relative;
}

.html-code-pre-custom {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    background: #f8f9fa !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 15px 40px 15px 15px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    max-height: 220px !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    color: var(--text) !important;
    tab-size: 2 !important;
}

.html-code-display-custom button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
}

/* Instructions section */
.instructions-custom code {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

/* Scrollbar styling */
.html-code-pre-custom::-webkit-scrollbar,
.favicon-preview-section-custom::-webkit-scrollbar,
.instructions-custom::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.html-code-pre-custom::-webkit-scrollbar-track,
.favicon-preview-section-custom::-webkit-scrollbar-track,
.instructions-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.html-code-pre-custom::-webkit-scrollbar-thumb,
.favicon-preview-section-custom::-webkit-scrollbar-thumb,
.instructions-custom::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.html-code-pre-custom::-webkit-scrollbar-thumb:hover,
.favicon-preview-section-custom::-webkit-scrollbar-thumb:hover,
.instructions-custom::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper-custom {
        flex-direction: column;
    }
    
    .left-panel-custom {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .right-panel-custom {
        flex: 1;
        padding: 15px;
        overflow-y: hidden;
        overflow-x: hidden !important;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
    }
    
    .preview-area-custom {
        flex: 0 0 300px;
        max-height: 300px;
        min-height: 300px;
    }
    
    .favicon-preview-grid-custom {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .favicon-preview-box {
        width: 56px;
        height: 56px;
    }
    
    .action-buttons-custom button:not(.primary) {
        min-width: 44px;
    }
    
    .html-code-pre-custom {
        font-size: 11px !important;
    }
    
    .preview-header-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dark-mode-toggle-custom {
        align-self: flex-end;
    }
    
    .quality-presets {
        flex-wrap: wrap;
    }
    
    .quality-preset-btn {
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .favicon-preview-grid-custom {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .favicon-preview-box {
        width: 48px;
        height: 48px;
    }
    
    .preview-area-custom {
        flex: 0 0 250px;
        max-height: 250px;
        min-height: 250px;
    }
    
    .upload-area-custom {
        min-height: 120px;
        padding: 12px 8px;
    }
    
    .action-buttons-custom {
        flex-direction: column;
    }
    
    .action-buttons-custom button {
        width: 100%;
    }
    
    .color-picker-container-custom {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .color-input-custom {
        min-width: 120px;
    }
    
    .html-code-pre-custom {
        font-size: 10px !important;
        padding: 12px 35px 12px 12px !important;
    }
    
    .html-code-display-custom button {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    
    .preview-header-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dark-mode-toggle-custom {
        align-self: flex-end;
    }
    
    .instructions-custom ol,
    .instructions-custom ul {
        padding-left: 15px;
    }
    
    .quality-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quality-preset-btn {
        font-size: 0.7rem;
        padding: 4px 6px;
    }
}

/* Small label style */
._small {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Toggle label */
.toggle-label {
    font-size: 0.8rem;
    color: var(--text-light);
}



/* SVG warning message */
.svg-warning {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.8rem;
    text-align: center;
    animation: pulse 2s infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.svg-warning i {
    margin-right: 6px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Background color container */
#bgColorContainer {
    transition: all 0.3s ease;
    overflow: hidden;
}


