/* BiomAPI Component Styles - Reusable UI Components */

/* ===== MAIN CONTAINER ===== */
.main-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: var(--spacing-xl);
    margin: 0 auto;
    max-width: 900px;
    position: relative;
}

@media (max-width: 768px) {
    .main-container {
        padding: var(--spacing-lg);
        margin: 0 auto;
        border-radius: 15px;
    }
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    background-color: var(--color-bg-white);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    background: var(--gradient-primary);
    color: white !important;
    border: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-header h5,
.card-header h5 i {
    color: white !important;
}

.card-body {
    padding: 1.5rem;
}

/* Specific card variants */
.results-card {
    height: auto;
    min-height: 250px;
}

.results-card .card-body {
    min-height: 200px;
    height: auto;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

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

/* Primary button */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Success button */
.btn-success {
    background: var(--gradient-success);
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    color: white;
}

/* Outline variants */
.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover:not(:disabled) {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

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

.btn-outline-danger:hover:not(:disabled) {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

/* Button sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Full width button */
.w-100 {
    width: 100%;
}

/* Close button */
.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.btn-close:hover {
    opacity: 1;
}

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

.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background-color: var(--color-bg-white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.form-control-lg {
    padding: 1rem;
    font-size: 1.125rem;
}

.form-control-sm {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.form-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Form check (checkboxes, radio) */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: var(--spacing-sm);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-left: 4px solid var(--color-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #991b1b;
    border-left: 4px solid var(--color-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #92400e;
    border-left: 4px solid var(--color-warning);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c4a6e;
    border-left: 4px solid var(--color-info);
}

/* ===== BADGES ===== */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

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

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

.badge-warning {
    background-color: var(--color-warning);
    color: #000;
}

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

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-ok {
    background-color: var(--color-success);
}

.status-error {
    background-color: var(--color-danger);
}

.status-warning {
    background-color: var(--color-warning);
}

/* ===== LOGO & TITLE ===== */
.logo-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.biomapi-logo {
    width: 50px;
    height: 50px;
    border-radius: 0px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

@media (max-width: 768px) {
    .logo-title-container {
        gap: 0.75rem;
    }

    .biomapi-logo {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .logo-title-container {
        gap: 0.5rem;
        flex-direction: column;
    }

    .biomapi-logo {
        width: 45px;
        height: 45px;
        margin-bottom: 0.5rem;
    }
}

/* ===== FOOTER ===== */
.footer-enhanced {
    background: rgba(102, 126, 234, 0.08);
    padding: var(--spacing-xl) var(--spacing-lg);
    margin: -2rem -2rem -2rem -2rem;
    margin-top: var(--spacing-xl);
    border-radius: 0 0 20px 20px;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
}

.footer-warning {
    color: var(--color-danger) !important;
    font-weight: 500;
}

.footer-api {
    font-size: 0.875rem;
}

/* ===== NAV TABS ===== */
.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: #d1d5db;
    color: var(--color-text-dark);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

/* Mobile nav tabs */
@media (max-width: 560px) {
    .nav-tabs {
        flex-wrap: nowrap;
        justify-content: space-around;
    }

    .nav-tabs .nav-link {
        padding: 1rem 0.75rem;
        min-width: 60px;
    }

    .nav-tabs .nav-link .tab-text {
        display: none;
    }

    .nav-tabs .nav-link i {
        font-size: 1.4rem !important;
        margin: 0 !important;
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
}

/* ===== NAV PILLS ===== */
.nav-pills {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.nav-pills .nav-link {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: transparent;
    border: 2px solid #e2e8f0;
    color: var(--color-text-muted);
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: #cbd5e1;
    color: var(--color-primary);
}

.nav-pills .nav-link.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    padding: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.show {
    display: block;
}

.tab-pane.active {
    display: block;
}

/* ===== PROGRESS BAR ===== */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(102, 126, 234, 0.1);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

/* ===== SPINNER ===== */
.processing-spinner {
    display: none;
}

.spinner-border {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.5rem;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3rem);
}

.modal-dialog-scrollable {
    max-height: calc(100% - 3rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: white;
    background-clip: padding-box;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    outline: 0;
}

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

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 600;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 15px 15px;
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 300px;
}

/* ===== INPUT GROUP ===== */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .btn {
    position: relative;
    flex: 1 1 auto;
    margin: 0;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .btn {
    flex: 0 0 auto;
}

.input-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ===== DIVIDER ===== */
.or-divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.or-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #d1d5db 50%, transparent 100%);
    border: none;
    margin: 0;
}

.or-text {
    padding: 0 1rem;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== COLLAPSE ===== */
.collapse {
    display: none;
}

.collapse.show {
    display: block;
}

.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height var(--transition-normal);
}

/* ===== ROW & COLUMN LAYOUT ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col,
.col-12,
.col-lg-6,
.col-md-6 {
    position: relative;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Gap utilities */
.g-3 > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.g-5 > * {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

/* ===== LEAD TEXT ===== */
.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

/* ===== DISPLAY HEADINGS ===== */
.display-4 {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
}

/* ===== BORDER UTILITIES ===== */
.border-bottom {
    border-bottom: 1px solid #e5e7eb;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
    transition: transform var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* ===== CLEAR BIOMETRY BUTTON ===== */
.clear-biometry-btn {
    background-color: #6c757d !important;
    border: none !important;
    color: white !important;
    transition: background-color var(--transition-fast) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
}

.clear-biometry-btn:hover {
    background-color: var(--color-danger) !important;
    transform: none !important;
}

/* ===== PURPLE BUTTON (Contact Form) ===== */
.btn-purple {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-purple:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: white;
}

.btn-purple:active {
    transform: translateY(0);
}

/* ===== CONTACT FORM STYLES ===== */
#contactForm .form-control,
#contactForm .form-control:focus {
    border-radius: 10px;
}

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

#contactFormStatus {
    margin-bottom: 1rem;
}

#contactFormStatus .alert {
    margin-bottom: 0;
}
