/* ===========================================
   PixelSuite Hub - UI Components
   Reusable button styles and UI elements
   =========================================== */

/* ===== Buttons ===== */
.btn {
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: var(--transition-base);
    font-family: var(--font-family);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--ps-blue) 0%, var(--ps-light-blue) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 100, 162, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--color-success);
    color: var(--text-white);
}

.btn-success:hover {
    background: #248277;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--color-warning);
    color: var(--text-white);
}

.btn-warning:hover {
    background: #e68900;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--color-info);
    color: var(--text-white);
}

.btn-info:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--ps-blue);
    color: var(--ps-blue);
}

.btn-outline:hover {
    background: var(--ps-blue);
    color: var(--text-white);
}

/* ===== Action Buttons Group ===== */
.action-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-sm {
    padding: 2px var(--space-2);
    font-size: 0.7rem;
}

.badge-primary {
    background: var(--ps-blue);
    color: var(--text-white);
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ===== Key Preview ===== */
.key-preview {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    background: var(--bg-muted);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: var(--transition-base);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--focus-ring);
}

.form-control:disabled {
    background: var(--bg-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

select.form-control {
    cursor: pointer;
}

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

.form-text {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-4) var(--space-5);
    background: var(--gradient-card-header);
    border-bottom: 1px solid var(--border-light);
    font-weight: var(--font-weight-semibold);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

/* ===== Modals ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

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

.modal-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ===== Loading States ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    border-top-color: var(--ps-blue);
    animation: spin 0.8s linear infinite;
}

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

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== Tooltips ===== */
.tooltip {
    position: absolute;
    background: var(--bg-dark);
    color: var(--text-white);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
}

/* ===== Utilities ===== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}
