/* TCD Builder Root */
.tcd-builder-root {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Configuration Sections */
.config-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section h3 i {
    color: #6c757d;
}

/* Field Styles */
.field {
    margin-bottom: 1.5rem;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Help Text */
.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6c757d;
}

.help-text code {
    background: #e9ecef;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.875rem;
    color: #d63384;
}

.help-text a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px dotted #0066cc;
}

.help-text a:hover {
    color: #0052a3;
    border-bottom-style: solid;
}

/* Date Interval Configuration */
.date-interval-config {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Formula Textarea & Custom Lines Textarea */
.formula-textarea textarea,
.custom-lines-textarea textarea {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: #ffffff;
    border: 1px solid #ced4da;
}

.formula-textarea textarea:focus,
.custom-lines-textarea textarea:focus {
    background: #ffffff;
}

/* Examples Containers */
.formula-examples,
.format-examples {
    margin-top: 0.75rem;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formula Examples */
.formula-examples .example {
    margin-bottom: 1.25rem;
}

.formula-examples .example:last-child {
    margin-bottom: 0;
}

.formula-examples .example strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.formula-examples .example pre {
    margin: 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    color: #212529;
}

/* Format Examples Table */
.format-examples table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.format-examples td {
    padding: 0.375rem 0.5rem;
}

.format-examples tr:nth-child(even) {
    background: #f8f9fa;
}

.format-examples td:first-child {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    color: #0066cc;
    font-weight: 500;
}

.format-examples td:nth-child(2) {
    text-align: center;
    color: #6c757d;
    width: 2rem;
}

.format-examples td:nth-child(3) {
    color: #495057;
}

/* PrimeVue Overrides for Better Styling */
.tcd-builder-root .p-dropdown,
.tcd-builder-root .p-inputtext,
.tcd-builder-root .p-calendar {
    width: 100%;
}

.tcd-builder-root .p-calendar .p-inputtext {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcd-builder-root {
        padding: 1rem;
    }

    .config-section {
        padding: 1rem;
    }

    .field-group {
        grid-template-columns: 1fr;
    }

    .config-section h3 {
        font-size: 1.1rem;
    }
}

/* Loading State (for future use) */
.tcd-builder-root.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tcd-builder-root.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
