@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;
}

/* Mode Selection */
.mode-selection {
    margin-bottom: 30px;
}

.mode-selection h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 12px 20px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.mode-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.mode-btn.disabled {
    background: #e9ecef;
    color: #999;
    border-color: #dee2e6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mode-btn.disabled:hover {
    border-color: #dee2e6;
    color: #999;
    transform: none;
    box-shadow: none;
}

/* Operation Selection */
.operation-selection {
    margin-bottom: 30px;
}

.operation-selection h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--font-color);
}

.radio-group {
    display: flex;
    gap: 30px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--font-color);
    position: relative;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #4CAF50;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-label:hover .radio-custom {
    border-color: #4CAF50;
}

.radio-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input and Output Sections */
.input-section,
.output-section {
    margin-bottom: 30px;
}

.input-section h3,
.output-section h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--font-color);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Text Areas */
textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: var(--alt-content-bg-color, #fff);
    color: var(--font-color);
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

textarea::placeholder {
    color: #999;
    font-style: italic;
}

#outputText {
    background: var(--alt-content-bg-color, #fff);
    color: var(--font-color);
    cursor: default;
    height: 400px;
}

#outputText.error {
    color: #dc3545;
    font-weight: bold;
}

/* 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;
}

.copy-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.copy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.copy-btn.copied {
    background: #28a745;
}

/* 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 .mode-btn {
    background: #2d2d2d;
    color: #ccc;
    border-color: #444;
}

body.dark-mode .mode-btn:hover:not(.disabled) {
    border-color: #4CAF50;
    color: #4CAF50;
}

body.dark-mode .mode-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

body.dark-mode .mode-btn.disabled {
    background: #1a1a1a;
    color: #666;
    border-color: #333;
}

body.dark-mode .radio-custom {
    border-color: #CCC;
}

body.dark-mode textarea {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-color: #555;
}

body.dark-mode textarea::placeholder {
    color: #777;
}

body.dark-mode #outputText.error {
    color: #ff6b6b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 2em;
    }
    
    .mode-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .mode-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .radio-group {
        gap: 20px;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    textarea {
        min-height: 100px;
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
}

