/**
 * A2UI Styles
 * Native styling for A2UI components matching ArihantAI design system
 */

/* Container */
.a2ui-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #293241;
    line-height: 1.6;
    padding: 20px;
}

/* Loading */
.a2ui-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6C757D;
}

.a2ui-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E9ECEF;
    border-top-color: #0A2463;
    border-radius: 50%;
    animation: a2ui-spin 0.8s linear infinite;
}

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

/* Text Components */
.a2ui-text {
    margin: 0 0 12px;
}

.a2ui-text-heading {
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #293241;
    margin-bottom: 8px;
}

.a2ui-text-body {
    font-size: 1rem;
    color: #495057;
}

.a2ui-text-caption {
    font-size: 0.875rem;
    color: #6C757D;
}

.a2ui-text-error {
    color: #DC3545;
}

/* Labels */
.a2ui-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #293241;
    margin-bottom: 6px;
}

/* Buttons */
.a2ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin: 4px;
}

.a2ui-button-primary {
    background: linear-gradient(135deg, #0A2463, #1E4DB7);
    color: white;
    border-color: #0A2463;
}

.a2ui-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 36, 99, 0.3);
}

.a2ui-button-secondary {
    background: white;
    color: #0A2463;
    border-color: #0A2463;
}

.a2ui-button-secondary:hover {
    background: #F8F9FA;
}

.a2ui-button-outline {
    background: transparent;
    color: #0A2463;
    border-color: #DEE2E6;
}

.a2ui-button-outline:hover {
    border-color: #0A2463;
}

/* Inputs */
.a2ui-input-wrapper,
.a2ui-datepicker-wrapper,
.a2ui-select-wrapper {
    margin-bottom: 16px;
}

.a2ui-input,
.a2ui-datepicker,
.a2ui-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #DEE2E6;
    border-radius: 12px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #293241;
}

.a2ui-input:focus,
.a2ui-datepicker:focus,
.a2ui-select:focus {
    outline: none;
    border-color: #0A2463;
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

.a2ui-input::placeholder {
    color: #ADB5BD;
}

/* Checkbox Group */
.a2ui-checkbox-group {
    margin-bottom: 16px;
}

.a2ui-checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.a2ui-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #DEE2E6;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.a2ui-checkbox-item:hover {
    border-color: #0A2463;
}

.a2ui-checkbox-item:has(input:checked) {
    background: #0A2463;
    color: white;
    border-color: #0A2463;
}

.a2ui-checkbox-item input {
    display: none;
}

/* Cards */
.a2ui-card {
    background: white;
    border: 1px solid #E9ECEF;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.a2ui-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.a2ui-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.a2ui-card-title {
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #293241;
    margin: 0 0 8px;
}

.a2ui-card-description {
    color: #6C757D;
    margin: 0;
    font-size: 0.9rem;
}

/* Form */
.a2ui-form {
    margin-bottom: 16px;
}

/* Layout */
.a2ui-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.a2ui-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Progress Bar */
.a2ui-progress-wrapper {
    margin-bottom: 16px;
}

.a2ui-progress-label {
    display: block;
    font-size: 0.875rem;
    color: #6C757D;
    margin-bottom: 8px;
}

.a2ui-progress-bar {
    height: 8px;
    background: #E9ECEF;
    border-radius: 100px;
    overflow: hidden;
}

.a2ui-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* Alerts */
.a2ui-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.a2ui-alert-info {
    background: #E7F1FF;
    color: #0A2463;
    border-left: 4px solid #0A2463;
}

.a2ui-alert-success {
    background: #D4EDDA;
    color: #155724;
    border-left: 4px solid #28A745;
}

.a2ui-alert-warning {
    background: #FFF3CD;
    color: #856404;
    border-left: 4px solid #FFC107;
}

.a2ui-alert-error {
    background: #F8D7DA;
    color: #721C24;
    border-left: 4px solid #DC3545;
}

/* Widget Container */
.a2ui-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.a2ui-widget-header {
    background: linear-gradient(135deg, #0A2463, #1E4DB7);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.a2ui-widget-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.a2ui-widget-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.a2ui-widget-subtitle {
    opacity: 0.8;
    font-size: 0.8rem;
    margin: 0;
}

.a2ui-widget-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.a2ui-widget-close:hover {
    opacity: 1;
}

.a2ui-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F8F9FA;
}

.a2ui-widget-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0A2463, #1E4DB7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(10, 36, 99, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a2ui-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(10, 36, 99, 0.5);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .a2ui-widget {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-height: 80vh;
    }

    .a2ui-row {
        flex-direction: column;
    }

    .a2ui-button {
        width: 100%;
    }
}