/* Bail Bond Calculator Plugin Styles */

.bbc-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    display: none !important;
}

.bbc-honeypot input {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    border: none !important;
    background: transparent !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    tab-index: -1 !important;
}

.bail-bond-calculator-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

.bbc-calculator-section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    display: block;
}

/* Layout when image is shown */
.bbc-calculator-section.bbc-has-image {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Layout when no image - ensures proper sizing */
.bbc-calculator-section.bbc-no-image {
    display: block;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.bbc-calculator-section.bbc-no-image .bbc-calculator-content {
    max-width: none;
}

@media (min-width: 768px) {
    .bbc-calculator-section.bbc-has-image {
        grid-template-columns: 1fr 1fr;
        max-width: 800px;
    }
    
    .bbc-calculator-section.bbc-no-image {
        max-width: 500px;
    }
}

.bbc-calculator-content {
    display: flex;
    flex-direction: column;
}

.bbc-calculator-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e40af;
    line-height: 1.2;
}

.bbc-calculator-form {
    max-width: 400px;
}

.bbc-input-group {
    margin-bottom: 1.5rem;
}

.bbc-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1rem;
}

.bbc-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: #ffffff;
}

.bbc-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bbc-input::placeholder {
    color: #9ca3af;
}

.bbc-input-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.bbc-result {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
    box-sizing: border-box;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.bbc-result.bbc-success {
    color: #059669;
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.bbc-result.bbc-error {
    color: #dc2626;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.bbc-calculate-btn,
.bbc-cta-btn {
    width: 100%;
    background-color: #1e40af;
    color: white;
    font-weight: 700;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-sizing: border-box;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbc-calculate-btn:hover,
.bbc-cta-btn:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
}

.bbc-calculate-btn:active,
.bbc-cta-btn:active {
    transform: translateY(0);
}

.bbc-calculate-btn:focus,
.bbc-cta-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.bbc-calculate-btn:disabled,
.bbc-cta-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.bbc-message-container {
    margin-top: 1rem;
}

.bbc-cta-message {
    text-align: center;
    margin-top: 1rem;
    color: #374151;
    font-size: 0.95rem;
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.bbc-cash-bond-message {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-weight: 600;
    font-size: 0.95rem;
}

.bbc-calculator-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbc-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bail-bond-calculator-error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    text-align: center;
}

/* Widget Specific Styles */
.widget .bail-bond-calculator-container {
    max-width: none;
}

.widget .bbc-calculator-section {
    padding: 1.5rem;
}

.widget .bbc-calculator-section.bbc-no-image {
    max-width: none;
}

.widget .bbc-calculator-title {
    font-size: 1.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .bbc-calculator-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .bbc-calculator-section.bbc-no-image {
        max-width: none;
    }
    
    .bbc-calculator-title {
        font-size: 1.5rem;
    }
    
    .bbc-calculator-form {
        max-width: none;
    }
}

/* Loading State */
.bbc-calculating {
    opacity: 0.7;
    pointer-events: none;
}

.bbc-calculate-btn.bbc-loading,
.bbc-cta-btn.bbc-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.bbc-calculate-btn.bbc-loading::after,
.bbc-cta-btn.bbc-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: bbc-spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Accessibility Improvements */
.bbc-calculate-btn:focus-visible,
.bbc-cta-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bbc-input {
        border-width: 3px;
    }
    
    .bbc-calculate-btn,
    .bbc-cta-btn {
        border: 2px solid transparent;
    }
    
    .bbc-calculator-section {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bbc-calculate-btn,
    .bbc-cta-btn,
    .bbc-input {
        transition: none;
    }
    
    .bbc-calculate-btn.bbc-loading::after,
    .bbc-cta-btn.bbc-loading::after {
        animation: none;
    }
    
    .bbc-cta-message {
        animation: none;
    }
}

/* Ensure proper form layout */
.bbc-calculator-form > * {
    width: 100%;
}

/* Button states */
.bbc-cta-mode {
    /* Additional styles for CTA mode if needed */
}

/* Print styles */
@media print {
    .bbc-calculator-section {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .bbc-calculate-btn,
    .bbc-cta-btn {
        background-color: #000 !important;
        color: #fff !important;
    }
}

/* Enhanced visual feedback */
.bbc-input:valid {
    border-color: #10b981;
}

.bbc-input:invalid {
    border-color: #ef4444;
}

/* Smooth transitions for all interactive elements */
.bbc-calculator-section * {
    box-sizing: border-box;
}

/* Ensure buttons maintain consistent sizing */
.bbc-calculate-btn,
.bbc-cta-btn {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Better spacing for mobile */
@media (max-width: 640px) {
    .bbc-calculator-section {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .bbc-calculator-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .bbc-input-group {
        margin-bottom: 1.25rem;
    }
}