/**
 * Land Development Calculator Styles
 * 
 * Modern, responsive styling for the calculator widget
 * 
 * @package Land_Development_Calculator
 * @version 1.0.0
 */

/* CSS Variables */
.land-development-calculator {
    --ldc-primary-color: #16a34a;
    --ldc-secondary-color: #f3f4f6;
    --ldc-text-color: #1f2937;
    --ldc-button-text-color: #ffffff;
    --ldc-border-color: #e5e7eb;
    --ldc-border-radius: 8px;
    --ldc-spacing: 1.5rem;
    --ldc-transition: all 0.3s ease;
}

/* Main Container */
.land-development-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--ldc-text-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
}

.land-development-calculator * {
    box-sizing: border-box;
}

/* Header */
.ldc-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ldc-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ldc-text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.ldc-description {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Content Layout */
.ldc-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .ldc-content {
        grid-template-columns: 1fr;
    }
}

/* Form Container */
.ldc-form-container,
.ldc-results-container {
    background: #ffffffcc;
    border: 1px solid var(--ldc-border-color);
    border-radius: var(--ldc-border-radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.ldc-section-header {
    margin-bottom: 1.5rem;
}

.ldc-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ldc-text-color);
    margin: 0 0 0.5rem 0;
}

.ldc-section-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Form Elements */
.ldc-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ldc-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ldc-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ldc-text-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ldc-label-helper {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    line-height: 1.4;
}

.ldc-input,
.ldc-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ldc-text-color);
    background-color: #ffffff;
    border: 1px solid var(--ldc-border-color);
    border-radius: 6px;
    transition: var(--ldc-transition);
    outline: none;
}

.ldc-input:focus,
.ldc-select:focus {
    border-color: var(--ldc-primary-color);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.ldc-input:hover,
.ldc-select:hover {
    border-color: #9ca3af;
}

.ldc-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Checkbox */
.ldc-checkbox-group {
    flex-direction: row;
    align-items: center;
}

.ldc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.ldc-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--ldc-border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--ldc-transition);
    accent-color: var(--ldc-primary-color);
}

.ldc-checkbox:checked {
    background-color: var(--ldc-primary-color);
    border-color: var(--ldc-primary-color);
}

/* Section Divider */
.ldc-section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0 1rem 0;
    position: relative;
}

.ldc-section-divider::before,
.ldc-section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--ldc-border-color);
}

.ldc-section-divider span {
    padding: 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Conditional Fields */
.ldc-conditional-field {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.ldc-conditional-field[style*="display: none"] {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* Button */
.ldc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--ldc-transition);
    text-decoration: none;
    outline: none;
}

.ldc-button-primary {
    background-color: var(--ldc-primary-color);
    color: var(--ldc-button-text-color);
}

.ldc-button-primary:hover {
    background-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ldc-button-primary:active {
    transform: translateY(0);
}

.ldc-button-icon {
    font-size: 1.125rem;
}

/* Results */
.ldc-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ldc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background-color: var(--ldc-secondary-color);
    border-radius: 6px;
    transition: var(--ldc-transition);
}

.ldc-result-item:hover {
    background-color: #e5e7eb;
}

.ldc-result-info {
    flex: 1;
}

.ldc-result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ldc-text-color);
    margin: 0 0 0.25rem 0;
}

.ldc-result-description {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.ldc-result-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ldc-text-color);
    white-space: nowrap;
    margin-left: 1rem;
}

/* Total Section */
.ldc-result-total {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    border: 2px solid var(--ldc-primary-color);
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.ldc-result-total .ldc-result-label {
    font-size: 1rem;
    color: var(--ldc-primary-color);
}

.ldc-result-total .ldc-result-value {
    font-size: 1.5rem;
    color: var(--ldc-primary-color);
}

/* Zero Cost Items */
.ldc-result-zero {
    opacity: 0.6;
}

.ldc-result-zero .ldc-result-value {
    color: #9ca3af;
    font-weight: 600;
}

/* Cost Range */
.ldc-cost-range {
    background-color: #eff6ff;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.ldc-cost-range h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 0.75rem 0;
}

.ldc-range-values {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ldc-range-item {
    flex: 1;
    text-align: center;
}

.ldc-range-item p:first-child {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
}

.ldc-range-item p:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    margin: 0;
}

/* Placeholder */
.ldc-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.ldc-placeholder-content {
    padding: 2rem;
}

.ldc-placeholder-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ldc-text-color);
    margin: 0 0 0.5rem 0;
}

.ldc-placeholder-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Disclaimer */
.ldc-disclaimer {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-size: 0.813rem;
    line-height: 1.6;
    color: #92780e;
}

.ldc-disclaimer strong {
    font-weight: 700;
    color: #78630f;
}

/* Editor Notice */
.ldc-editor-notice {
    background-color: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.ldc-editor-notice p {
    margin: 0;
    font-size: 0.875rem;
    color: #1e40af;
    text-align: center;
}

/* Loading State */
.ldc-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ldc-button.ldc-loading::after {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid var(--ldc-button-text-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ldc-spin 0.6s linear infinite;
}

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

/* Animations */
@keyframes ldc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ldc-results {
    animation: ldc-fadeIn 0.4s ease-out;
}

.ldc-result-item {
    animation: ldc-fadeIn 0.4s ease-out;
}

.ldc-result-item:nth-child(1) { animation-delay: 0.05s; }
.ldc-result-item:nth-child(2) { animation-delay: 0.1s; }
.ldc-result-item:nth-child(3) { animation-delay: 0.15s; }
.ldc-result-item:nth-child(4) { animation-delay: 0.2s; }
.ldc-result-item:nth-child(5) { animation-delay: 0.25s; }
.ldc-result-item:nth-child(6) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .land-development-calculator {
        padding: 1rem;
    }

    .ldc-title {
        font-size: 1.5rem;
    }

    .ldc-description {
        font-size: 0.875rem;
    }

    .ldc-form-container,
    .ldc-results-container {
        padding: 1rem;
    }

    .ldc-result-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ldc-result-value {
        margin-left: 0;
        align-self: flex-start;
    }

    .ldc-range-values {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ldc-title {
        font-size: 1.25rem;
    }

    .ldc-button {
        width: 100%;
    }

    .ldc-section-divider span {
        font-size: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .ldc-form-container {
        display: none;
    }

    .ldc-placeholder {
        display: none;
    }

    .land-development-calculator {
        max-width: 100%;
    }

    .ldc-content {
        display: block;
    }
}
