/* ============================================
 * bridge-ui/styles/components.css
 * Componentes visuais reutilizáveis
 * ============================================ */

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    text-decoration: none;
    background: transparent;
    color: var(--color-text-primary);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: #fff;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-ghost {
    color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ---- Inputs & Selects ---- */
.input, .select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    font-size: 13px;
    color: var(--color-text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.input:focus, .select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-dropbox {
    background: rgba(0, 97, 254, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(0, 97, 254, 0.3);
}

.badge-drive {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.badge-running {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
    animation: pulse 2s infinite;
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- Progress Bars ---- */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar-fill.success {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.progress-bar-fill.danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

/* ---- Checkboxes ---- */
.custom-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* ---- Modals ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.modal-content.modal-details {
    max-width: 680px;
    max-height: 88vh;
    padding: 0;
    overflow: hidden;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ---- Responsive Modal Styles (< 640px) ---- */
@media (max-width: 640px) {
    .modal-content {
        padding: 18px;
        max-width: calc(100% - 24px);
        margin: 12px;
        max-height: 92dvh;
        max-height: 92vh;
        overflow-y: auto;
    }

    .modal-content.modal-details {
        max-width: calc(100% - 16px);
        max-height: 94dvh;
        max-height: 94vh;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
        margin-top: 18px;
    }

    .modal-actions .btn {
        width: 100%;
        min-height: 42px;
    }
}
