/**
 * AgentPrem Component Styles
 * Buttons, forms, cards, modals, alerts
 */

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: var(--text-light);
}

.btn-primary:hover:not(:disabled) {
    background-color: #e07800;
}

.btn-secondary {
    background-color: var(--bg-medium);
    color: var(--text-light);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-deep-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--bg-medium);
    color: var(--bg-medium);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-medium);
    color: var(--text-light);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background-color: #dc3545;
    color: var(--text-light);
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--font-size-lg);
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
}

/* ==========================================
   FORMS
   ========================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    background-color: var(--panel-bg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--bg-medium);
    box-shadow: 0 0 0 3px rgba(33, 158, 188, 0.15);
}

.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    color: var(--text-dark);
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* ==========================================
   MODALS
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-strong);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: var(--z-modal);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
}

/* ==========================================
   ALERTS / TOASTS
   ========================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    font-weight: 500;
    z-index: var(--z-toast);
    animation: slideInRight 0.3s ease;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-warning {
    background-color: var(--accent-orange);
}

.toast-info {
    background-color: var(--bg-medium);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-primary {
    background-color: var(--bg-medium);
    color: var(--text-light);
}

.badge-success {
    background-color: #28a745;
    color: var(--text-light);
}

.badge-warning {
    background-color: var(--accent-yellow);
    color: var(--text-dark);
}

.badge-danger {
    background-color: #dc3545;
    color: var(--text-light);
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--bg-medium);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

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