/**
 * Apex27 Stamp Duty Calculator Styles
 * Clean, minimal design with white and light grays
 */

/* Base Container */
.apex27-stamp-duty-calculator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 30px;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Header */
.apex27-sdc__header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.apex27-sdc__title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.apex27-sdc__subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Form Elements */
.apex27-sdc__form {
    margin-bottom: 20px;
}

.apex27-sdc__field {
    margin-bottom: 24px;
}

.apex27-sdc__label {
    display: block;
    margin-bottom: 8px;
}

.apex27-sdc__label-text {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.apex27-sdc__label-help {
    font-size: 12px;
    color: #9ca3af;
}

/* Input Group */
.apex27-sdc__input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.apex27-sdc__currency {
    position: absolute;
    left: 16px;
    font-size: 18px;
    font-weight: 500;
    color: #6b7280;
    pointer-events: none;
}

.apex27-sdc__input {
    width: 100%;
    padding: 12px 16px 12px 36px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

.apex27-sdc__input:focus {
    outline: none;
    border-color: var(--primary, #6b7280);
    box-shadow: none;
}

.apex27-sdc__input::placeholder {
    color: #9ca3af;
}

/* Select */
.apex27-sdc__select {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.apex27-sdc__select:focus {
    outline: none;
    border-color: var(--primary, #6b7280);
    box-shadow: none;
}

/* Radio Group */
.apex27-sdc__radio-group {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.apex27-sdc__radio {
    display: block;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.apex27-sdc__radio:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.apex27-sdc__radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Fix: Highlight entire block when selected */
.apex27-sdc__radio:has(input[type="radio"]:checked) {
    border-color: var(--primary, #6b7280);
    background: #f9fafb;
}

.apex27-sdc__radio input[type="radio"]:checked ~ .apex27-sdc__radio-label {
    color: #111827;
}

.apex27-sdc__radio input[type="radio"]:checked ~ .apex27-sdc__radio-label .apex27-sdc__radio-title {
    color: var(--primary, #374151);
    font-weight: 700;
}

.apex27-sdc__radio-label {
    display: block;
    position: relative;
    pointer-events: none;
}

.apex27-sdc__radio-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.apex27-sdc__radio-desc {
    font-size: 12px;
    color: #9ca3af;
}

/* Buttons */
.apex27-sdc__actions {
    margin-top: 24px;
}

.apex27-sdc__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apex27-sdc__button--calculate {
    width: 100%;
    background: var(--primary, #6b7280);
    color: white;
}

.apex27-sdc__button--calculate:hover:not(:disabled) {
    background: var(--primary, #4b5563);
    transform: none;
    box-shadow: none;
    opacity: 0.9;
}

.apex27-sdc__button--calculate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.apex27-sdc__button--print,
.apex27-sdc__button--reset {
    background: #f3f4f6;
    color: #374151;
    margin-right: 12px;
}

.apex27-sdc__button--print:hover,
.apex27-sdc__button--reset:hover {
    background: #e5e7eb;
}

/* Results Section */
.apex27-sdc__results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f3f4f6;
}

/* Result Cards */
.apex27-sdc__result-card {
    padding: 20px;
    background: #f9fafb;
    border-radius: 0;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.apex27-sdc__result-card--primary {
    background: var(--primary, #6b7280);
    color: white;
    padding: 30px;
    margin-bottom: 20px;
    border: none;
}

.apex27-sdc__result-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.apex27-sdc__result-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.apex27-sdc__result-rate {
    font-size: 14px;
    opacity: 0.9;
}

.apex27-sdc__result-value {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-top: 8px;
}

/* Result Grid */
.apex27-sdc__result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Breakdown Table */
.apex27-sdc__breakdown {
    margin-top: 24px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 0;
    border: 1px solid #e5e7eb;
}

.apex27-sdc__breakdown-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #111827;
}

.apex27-sdc__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.apex27-sdc__table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.apex27-sdc__table td {
    padding: 12px;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}

.apex27-sdc__table tr:last-child td {
    border-bottom: none;
}

/* Notes */
.apex27-sdc__notes {
    margin-top: 20px;
    padding: 16px;
    background: #fef3c7;
    border-radius: 0;
    border-left: 4px solid #f59e0b;
}

.apex27-sdc__notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.apex27-sdc__notes-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.apex27-sdc__notes-list li:last-child {
    margin-bottom: 0;
}

.apex27-sdc__notes-list li:before {
    content: "ℹ";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #f59e0b;
}

/* Result Actions */
.apex27-sdc__result-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Loading State */
.apex27-sdc__loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.apex27-sdc__spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary, #6b7280);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error State */
.apex27-sdc__error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0;
    color: #dc2626;
    margin-top: 20px;
}

.apex27-sdc__error-message {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
    .apex27-stamp-duty-calculator {
        padding: 20px;
        margin: 10px;
    }

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

    .apex27-sdc__result-grid {
        grid-template-columns: 1fr;
    }

    .apex27-sdc__result-amount {
        font-size: 28px;
    }

    .apex27-sdc__table {
        font-size: 12px;
    }

    .apex27-sdc__result-actions {
        flex-direction: column;
    }

    .apex27-sdc__button {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .apex27-sdc__actions,
    .apex27-sdc__result-actions,
    .apex27-sdc__form {
        display: none !important;
    }

    .apex27-stamp-duty-calculator {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}