/**
 * Component Stylesheet — Domaination
 */

/* Buttons */
.btn-brand {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-brand:hover, .btn-brand:focus {
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    color: #ffffff;
}

.btn-brand:active {
    background-color: var(--brand-primary-active) !important;
    border-color: var(--brand-primary-active) !important;
}

.btn-outline-brand {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-brand:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
}

.btn-dark-subtle {
    background-color: #262a34;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-dark-subtle:hover {
    background-color: #2e3442;
    color: var(--text-primary);
    border-color: var(--border-color-light);
}

/* Icon Only Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.btn-icon i {
    font-size: 0.95rem;
    margin: 0 !important;
}

.btn-icon:hover {
    transform: translateY(-1px);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.btn-icon .spinner-border,
.btn-icon-sm .spinner-border {
    margin: 0 !important;
}

/* SweetAlert2 Toast Customization (Bottom-Right / Bottom-Left) */
.swal2-container.swal2-bottom-end,
.swal2-container.swal2-bottom-right,
.swal2-container.swal2-bottom-start,
.swal2-container.swal2-bottom-left {
    padding: 1.5rem !important;
    z-index: 1080 !important;
}

.swal2-popup.swal2-toast {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
}

/* Tooltip Custom Dark Theme */
.tooltip .tooltip-inner {
    background-color: #262b36;
    color: #f5f5f5;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    font-size: 0.76rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-weight: 500;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--border-color);
}
.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--border-color);
}
.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: var(--border-color);
}
.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: var(--border-color);
}

/* Forms & Inputs */
.form-control-dark, .form-select-dark {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control-dark:focus, .form-select-dark:focus {
    background-color: var(--bg-input);
    border-color: var(--brand-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-subtle);
    outline: none;
}

.form-control-dark::placeholder {
    color: var(--text-muted);
}

/* Input Groups with Leading Icon */
.input-group {
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group:focus-within {
    box-shadow: 0 0 0 3px var(--brand-primary-subtle);
    border-radius: var(--border-radius);
}

.input-group > .input-group-text:first-child {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-right: none !important;
    color: var(--text-secondary);
    padding-left: 0.95rem;
    padding-right: 0.35rem;
    border-top-left-radius: var(--border-radius) !important;
    border-bottom-left-radius: var(--border-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    transition: border-color var(--transition-fast);
}

.input-group > .input-group-text:first-child i {
    width: 18px;
    text-align: center;
}

.input-group:focus-within > .input-group-text:first-child {
    border-color: var(--brand-primary) !important;
}

.input-group > .input-group-text:first-child + .form-control-dark,
.input-group > .input-group-text:first-child + .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--border-radius) !important;
    border-bottom-right-radius: var(--border-radius) !important;
    border-left: none !important;
    padding-left: 0.75rem !important; /* Memberikan ruang proporsional agar teks tidak menempel dengan icon */
}

.input-group:focus-within > .input-group-text:first-child + .form-control-dark,
.input-group:focus-within > .input-group-text:first-child + .form-control {
    border-color: var(--brand-primary) !important;
    box-shadow: none !important;
}

.form-label-dark {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

/* Badges & Pills */
.badge-status {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
}

.badge-status-active, .badge-status-connected, .badge-status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-invalid, .badge-status-failure, .badge-status-disabled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-status-pending, .badge-status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Cloudflare Proxy Badges */
.badge-proxied-on {
    background: rgba(244, 129, 32, 0.15);
    color: var(--brand-primary);
    border: 1px solid rgba(244, 129, 32, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-proxied-off {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(156, 163, 175, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* DNS Type Badges */
.badge-dns-type {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #282e3b;
    color: #e2e8f0;
    border: 1px solid #374151;
}

/* Custom Checkboxes */
.form-check-input-dark {
    background-color: var(--bg-input);
    border-color: var(--border-color);
}
.form-check-input-dark:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Auth Pages Style */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 20%, rgba(244, 129, 32, 0.05) 0%, transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* Universal Bootstrap Modals — Dark SaaS Theme */
.modal-content,
.modal-content-dark {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    background-color: transparent !important;
}

.modal-header .modal-title {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    background-color: transparent !important;
}

.modal-backdrop.show {
    opacity: 0.72 !important;
    background-color: #0b0d12 !important;
}

/* PJAX / SPA Top Progress Bar */
#appProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #F48120, #ffa502);
    z-index: 99999;
    pointer-events: none;
    transition: width 0.25s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(244, 129, 32, 0.9), 0 0 5px rgba(244, 129, 32, 0.6);
    opacity: 0;
}



