/* CSV ↔ JSON Converter Specific Styles */
.tool-page-shell .converter-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.converter-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}

.input-section, .output-section {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(94, 65, 30, 0.12);
    border: 1px solid rgba(145, 103, 48, 0.2);
    display: flex;
    flex-direction: column;
}

.input-header, .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(145, 103, 48, 0.2);
}

.input-header h3, .output-header h3 {
    color: #5e4329;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Format Selector Radio Buttons */
.format-selector {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a351f;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(145, 103, 48, 0.4);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    background: #ab7c34;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #ab7c34;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-label:hover {
    color: #7a572c;
}

/* Textarea Container */
.textarea-container {
    margin-bottom: 20px;
    position: relative;
}

#inputData, #outputData {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: #fffaf2;
    border: 2px solid rgba(145, 103, 48, 0.22);
    border-radius: 8px;
    color: #4a351f;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#outputData {
    min-height: 300px; /* Increased height for output */
}

#inputData:focus {
    outline: none;
    border-color: #ab7c34;
    box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
    transform: translateY(-1px);
}

#outputData {
    background: #fff8ef;
    border-color: rgba(145, 103, 48, 0.3);
    cursor: default;
    display: none; /* Hidden by default */
}

#outputData:focus {
    outline: none;
    border-color: #ab7c34;
    box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
    transform: translateY(-1px);
}

.character-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8rem;
    color: #8c7558;
    background: rgba(248, 238, 222, 0.95);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.character-counter.warning {
    color: #b26e1f;
}

.character-counter.error {
    color: #9a3f2b;
}

/* Options Section */
.options-section {
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.option-group label {
    color: #5e4329;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.option-group select {
    padding: 8px 12px;
    background: #fffaf2;
    border: 2px solid rgba(145, 103, 48, 0.22);
    border-radius: 6px;
    color: #4a351f;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 150px;
}

.option-group select:focus {
    outline: none;
    border-color: #ab7c34;
    box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a351f;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(145, 103, 48, 0.4);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-custom::after {
    content: '\2713';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #ab7c34;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #ab7c34;
    background: rgba(171, 124, 52, 0.1);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
}

.checkbox-label:hover {
    color: #7a572c;
}

/* Button Container matching index.html style */
.btn-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn i{
    margin-right: 10px;
}


.btn-secondary {
    background: transparent;
    border: 1px solid rgba(145, 103, 48, 0.4);
    color: #7a572c;
}

.btn-secondary:hover {
    background: rgba(182, 138, 58, 0.12);
    color: #5e4329;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: transparent;
    border: 1px solid rgba(145, 103, 48, 0.3);
    color: #7a572c;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: rgba(182, 138, 58, 0.12);
    border-color: #ab7c34;
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Output Display */
.output-display {
    flex-grow: 1;
    position: relative;
}

.no-output-message {
    color: #8c7558;
    text-align: center;
    padding: 60px 20px;
    border: 2px dashed rgba(145, 103, 48, 0.3);
    border-radius: 12px;
    background: rgba(182, 138, 58, 0.07);
    font-weight: 500;
    letter-spacing: 0.5px;
    min-height: 300px; /* Match output textarea height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-output-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    opacity: 0.7;
    color: #b98b3b;
}

.no-output-message p {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: #5e4329;
    font-weight: 600;
}

.no-output-message span {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #7b6245;
}

.no-output-message.hidden {
    display: none;
}

#outputData.show {
    display: block !important;
}

#outputData[style*="block"] {
    display: block !important;
}

.error-message {
    color: #9a3f2b;
    background: rgba(173, 82, 47, 0.12);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(154, 63, 43, 0.26);
    text-align: center;
    font-weight: 500;
    display: none;
    margin-top: 15px;
}

.error-message.show {
    display: block;
}

/* Disclaimer Section - Orange Theme */

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #b98b3b;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
}

.toast.error {
  background: #c94a3a;
  color: #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .converter-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .converter-container {
        padding: 15px 0;
    }
    
    .input-section,
    .output-section {
        padding: 20px;
    }
    
    .input-header, .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .format-selector {
        width: 100%;
        justify-content: flex-start;
    }
    
    .output-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #copyBtn.copied {
        animation: copyPulse 0.6s ease;
        box-shadow: 0 0 15px rgba(171, 124, 52, 0.45);
    }

    #copyBtn.copied svg {
        display: inline-block;
        vertical-align: middle;
    }

    @keyframes copyPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1.05); }
    }

    @keyframes copyPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1.05); }
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .option-group label {
        min-width: auto;
    }
    
    .option-group select {
        width: 100%;
        min-width: auto;
    }
    
    #inputData, #outputData {
        min-height: 250px;
        font-size: 0.85rem;
    }
    
    
    .toast {
        top: auto;
        bottom: 100px;
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .converter-container {
        padding: 10px 0;
    }
    
    .input-section,
    .output-section {
        padding: 15px;
    }
    
    
    #inputData, #outputData {
        min-height: 180px;
        font-size: 0.8rem;
        padding: 12px;
    }
    
    .character-counter {
        font-size: 0.7rem;
    }
    
    .no-output-message {
        padding: 40px 15px;
    }
    
    .no-output-message i {
        font-size: 2rem;
    }
}
