@charset "UTF-8";

/* Add smooth scrolling to the html element */
html {
    scroll-behavior: smooth;
}

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: 1200px;
    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;
}

/* Input Method Tabs */
.input-method-section {
    margin-bottom: 30px;
}

.input-method-section h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.input-method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    background: var(--alt-content-bg-color, #f8f9fa);
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.tab-btn:hover {
    border-color: #007bff;
    background: #e7f3ff;
}

.tab-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.tab-icon {
    font-size: 20px;
}

.tab-text {
    font-weight: 600;
}

/* Code Type Selection */
.code-type-section {
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--font-color);
}

.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: var(--content-bg-color, #fff);
    color: var(--font-color);
    box-sizing: border-box;
}

.input-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Input Methods */
.input-section {
    margin-bottom: 30px;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

/* Textarea Styling */
.textarea-container {
    position: relative;
}

.textarea-container textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: var(--alt-content-bg-color, #fff);
    color: var(--font-color);
    box-sizing: border-box;
    resize: vertical;
    min-height: 200px;
}

.textarea-container textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.textarea-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--font-color);
    opacity: 0.7;
}

.clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    background: #c82333;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--alt-content-bg-color, #f8f9fa);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #007bff;
    background: #e7f3ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-primary {
    font-size: 18px;
    font-weight: 600;
    color: var(--font-color);
    margin-bottom: 5px;
}

.upload-secondary {
    font-size: 14px;
    color: var(--font-color);
    opacity: 0.6;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 10px 15px;
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 8px;
    border: 2px solid #ddd;
}

.file-name {
    font-weight: 600;
    flex: 1;
}

.file-size {
    font-size: 12px;
    opacity: 0.7;
}

.remove-file-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.remove-file-btn:hover {
    background: #c82333;
}

/* Action Section */
.action-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 12px;
    border: 2px solid #ddd;
}

.minify-options {
    margin-bottom: 20px;
}

.options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.minify-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.minify-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-icon {
    font-size: 18px;
}

/* Output Section */
.output-section {
    margin-bottom: 30px;
}

.output-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    border: 2px solid #ddd;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--font-color);
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--font-color);
}

.output-actions {
    display: flex;
    gap: 10px;
}

.copy-btn,
.download-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #0056b3;
}

.download-btn {
    background: #28a745;
}

.download-btn:hover {
    background: #218838;
}

/* Examples Section */
.examples-section {
    margin-bottom: 30px;
}

.examples-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.example-card {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.example-card:hover {
    border-color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.example-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--font-color);
}

.example-desc {
    font-size: 12px;
    color: var(--font-color);
    opacity: 0.7;
}

/* Information Section */
.info-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-item {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #ddd;
}

.info-item h4 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: var(--font-color);
}

.info-item p {
    font-size: 14px;
    margin: 0;
    color: var(--font-color);
    opacity: 0.8;
    line-height: 1.5;
}

/* 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 .tab-btn,
body.dark-mode .file-upload-area,
body.dark-mode .file-info,
body.dark-mode .action-section,
body.dark-mode .result-stats,
body.dark-mode .example-card,
body.dark-mode .info-item {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-color: #555;
}

/* Dark mode inactive tab buttons - gray text */
body.dark-mode .tab-btn {
    color: #888;
}

/* Dark mode tab button hover */
body.dark-mode .tab-btn:hover {
    background: #404040;
    border-color: #007bff;
    color: #ccc;
}

/* Dark mode ACTIVE tab button - same as light mode */
body.dark-mode .tab-btn.active {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

/* Dark mode example card hover - ADD THIS */
body.dark-mode .example-card:hover {
    border-color: #28a745 !important;
    background: #404040 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

body.dark-mode .file-upload-area:hover,
body.dark-mode .file-upload-area.dragover {
    background: #404040;
    border-color: #007bff;
}

body.dark-mode .input-group select,
body.dark-mode .textarea-container textarea {
    background: var(--alt-content-bg-color);
    border-color: #555;
    color: var(--font-color);
}

/* Fix textarea background in dark mode */
body.dark-mode .textarea-container textarea {
    background: var(--alt-content-bg-color);
}

/* Ensure clear button styling in dark mode */
body.dark-mode .clear-btn {
    background: #dc3545;
    color: white;
}

body.dark-mode .clear-btn:hover {
    background: #c82333;
}

/* Fix remove file button in dark mode */
body.dark-mode .remove-file-btn {
    background: #dc3545;
    color: white;
}

body.dark-mode .remove-file-btn:hover {
    background: #c82333;
}

/* Ensure minify button maintains proper styling */
body.dark-mode .minify-btn {
    background: #28a745;
    color: white;
}

body.dark-mode .minify-btn:hover {
    background: #218838;
}

body.dark-mode .minify-btn:disabled {
    background: #6c757d;
    color: #adb5bd;
}

/* Fix copy and download button styling */
body.dark-mode .copy-btn {
    background: #007bff;
    color: white;
}

body.dark-mode .copy-btn:hover {
    background: #0056b3;
}

body.dark-mode .download-btn {
    background: #28a745;
    color: white;
}

body.dark-mode .download-btn:hover {
    background: #218838;
}

/* Fix checkbox styling in dark mode */
body.dark-mode .checkbox-group {
    color: var(--font-color);
}

body.dark-mode .checkbox-group input[type="checkbox"] {
    accent-color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 2em;
    }
    
    .input-method-tabs {
        flex-direction: column;
    }
    
    .options-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .examples-grid,
    .info-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-content {
        padding: 15px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-icon {
        font-size: 16px;
    }
    
    .tab-text {
        font-size: 12px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .upload-primary {
        font-size: 16px;
    }
    
    .minify-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .output-actions {
        flex-direction: column;
    }
}