/**
 * Biometric Authentication Styles
 */

#biometric-auth-section {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.biometric-message {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: none;
}

.biometric-message-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.biometric-message-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.biometric-message-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

#biometric-register-btn,
#biometric-authenticate-btn,
.biometric-btn {
    width: 100%;
    padding: 16px 24px;
    margin-bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#biometric-register-btn:hover,
#biometric-authenticate-btn:hover,
.biometric-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#biometric-register-btn:active,
#biometric-authenticate-btn:active,
.biometric-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

#biometric-register-btn i,
#biometric-authenticate-btn i,
.biometric-btn i {
    font-size: 18px;
    line-height: 1;
}

/* Font Awesome icon support for biometric buttons */
.biometric-btn .icon-hand-pointer::before {
    content: "\f25a"; /* Hand pointer icon (FA 4.7+) */
}

.biometric-btn .icon-key::before {
    content: "\f084"; /* Key icon */
}

.biometric-btn .icon-lock::before {
    content: "\f023"; /* Lock icon */
}

.biometric-btn .icon-shield::before {
    content: "\f132"; /* Shield icon */
}

/* Ensure icons use FontAwesome font */
.biometric-btn .icon {
    font-family: "FontAwesome";
    font-weight: normal;
    font-style: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.biometric-auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.biometric-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.biometric-auth-divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: #6c757d;
    font-size: 14px;
}

/* Hide biometric section if WebAuthn not supported */
.no-webauthn #biometric-auth-section {
    display: none;
}

/* Icon styling for better visual appearance */
.biometric-btn i.icon-fingerprint,
.biometric-btn i.icon-hand-pointer,
.biometric-btn i.icon-key {
    font-family: "FontAwesome";
    font-weight: normal;
    font-style: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading state for buttons */
.biometric-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.biometric-btn.loading i::before {
    content: "\f110"; /* Spinner icon */
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Success state icon */
.biometric-btn.success i::before {
    content: "\f00c"; /* Check icon */
    color: #28a745;
}

/* Error state icon */
.biometric-btn.error i::before {
    content: "\f00d"; /* Times/X icon */
    color: #dc3545;
}

/* ============================================
   MODERN BIOMETRIC MANAGEMENT PAGE STYLES
   ============================================ */

.modern-biometric-page {
    padding: 20px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Modern Card Styles */
.modern-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
}

.modern-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    border-bottom: none;
}

.add-device-card .card-header {
    background: linear-gradient(135deg, #36BA46 0%, #1cb62e 100%);
}

.how-it-works-card .card-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    font-size: 20px;
    opacity: 0.95;
}

.card-body {
    padding: 24px;
}

/* Devices Card Specific */
.devices-intro {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
    color: #666;
}

/* Modern Table Styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.modern-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.modern-table thead {
    background: #f8f9fa;
}

.modern-table thead th {
    padding: 16px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    border-top: none;
}

.modern-table tbody tr {
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: #f8f9fa;
}

.modern-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.device-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.device-name-cell i {
    font-size: 18px;
    color: #667eea;
}

.date-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f4f8;
    color: #2c5f7d;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Remove Device Button */
.btn-remove-device {
    background: #ff4757;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-remove-device:hover {
    background: #ee3542;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    color: #ffffff;
}

.btn-remove-device i {
    font-size: 14px;
}

/* Add Device Card */
.device-description {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.device-subtext {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-register-device {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #36BA46 0%, #1cb62e 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(54, 186, 70, 0.3);
}

.btn-register-device:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(54, 186, 70, 0.4);
    background: linear-gradient(135deg, #1cb62e 0%, #36BA46 100%);
    color: #ffffff;
}

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

/* How It Works Card */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    counter-increment: step-counter;
}

.steps-list li:last-child {
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.step-text {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    padding-top: 4px;
}

/* Navigation Actions */
.navigation-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}

.nav-buttons-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.btn-nav {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    min-width: 160px;
    text-align: center;
}

.btn-nav-home {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-nav-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-nav-account {
    background: #ffffff;
    color: #667eea;
    border-color: #667eea;
}

.btn-nav-account:hover {
    background: #667eea;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.btn-nav-signout {
    background: linear-gradient(135deg, #ff4757 0%, #ee3542 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.btn-nav-signout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    background: linear-gradient(135deg, #ee3542 0%, #ff4757 100%);
    color: #ffffff;
    text-decoration: none;
}

.btn-nav i {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 767px) {
    .modern-biometric-page {
        padding: 15px 0;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .modern-table {
        font-size: 13px;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 12px 8px;
    }
    
    .nav-buttons-group {
        flex-direction: column;
    }
    
    .btn-nav {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .steps-list li {
        padding: 12px 0;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .step-text {
        font-size: 13px;
    }
}

/* Alert Messages Enhancement */
.modern-biometric-page .alert {
    border-radius: 8px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modern-biometric-page .alert-danger {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid #fc8181;
}

.modern-biometric-page .alert-success {
    background: #f0fff4;
    color: #22543d;
    border-left: 4px solid #68d391;
}

.modern-biometric-page .alert-info {
    background: #ebf8ff;
    color: #2c5282;
    border-left: 4px solid #90cdf4;
}

.modern-biometric-page .alert i {
    margin-right: 8px;
}

/* Hide sidebar sign out on biometric manage page (single Sign out in bottom nav) */
#module-shbiometricauth-biometricmanage #left_column .myaccount-column .logout,
#module-shbiometricauth-biometricmanage #left_column .block.myaccount .logout,
#module-shbiometricauth-biometricManage #left_column .myaccount-column .logout,
#module-shbiometricauth-biometricManage #left_column .block.myaccount .logout {
    display: none !important;
}

/* ============================================
   CUSTOM BIOMETRIC MODAL
   ============================================ */

.biometric-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.biometric-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.biometric-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.biometric-modal-inner {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    padding: 32px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.biometric-modal.is-open .biometric-modal-inner {
    transform: scale(1);
}

.biometric-modal-icon-wrap {
    margin-bottom: 20px;
}

.biometric-modal-icon {
    display: none;
    font-size: 48px;
    line-height: 1;
}

.biometric-modal-icon i {
    font-family: "FontAwesome";
    font-style: normal;
    font-weight: normal;
    -webkit-font-smoothing: antialiased;
}

.biometric-modal-icon-preparing i::before { content: "\f021"; }
.biometric-modal-icon-success i::before { content: "\f00c"; color: #28a745; }
.biometric-modal-icon-error i::before { content: "\f00d"; color: #dc3545; }

.biometric-modal.state-preparing .biometric-modal-icon-preparing,
.biometric-modal.state-success .biometric-modal-icon-success,
.biometric-modal.state-error .biometric-modal-icon-error {
    display: inline-block;
}

.biometric-modal-icon-preparing i {
    animation: biometric-modal-spin 1s linear infinite;
}

@keyframes biometric-modal-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.biometric-modal-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.biometric-modal-message {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.5;
    color: #666;
}

.biometric-modal-close {
    display: none !important;
    margin: 0 auto;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.biometric-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.biometric-modal-close i {
    margin-right: 8px;
}

.biometric-modal.state-success .biometric-modal-close,
.biometric-modal.state-error .biometric-modal-close {
    display: inline-flex !important;
    align-items: center;
}

.biometric-modal.state-preparing .biometric-modal-overlay {
    cursor: wait;
}
