/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding-top: 80px !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: static !important;
}

.container-wide {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 25px;
    position: static !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #2c3e50;
    font-weight: 600;
}

h1 {
    margin-bottom: 10px;
    font-size: 28px;
}

h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* ========================================
   GENERIC PAGE STYLES
   ========================================  */
.gen-page {
    background: linear-gradient(90deg, #eec3a4 0%, #ff6900 100%);
}

/* Form Control Border Styling */
.form-control {
    border-color: gray !important;
}

.form-control:focus {
    border-color: gray !important;
}

.form-control.required-field,
.form-select.required-field {
    border-color: #fd7e14 !important;
    border-width: 2px;
}

.form-control.required-field:focus,
.form-select.required-field:focus {
    border-color: #fd7e14 !important;
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.25) !important;
    ;
}

/* Disabled and Readonly Form Controls */
input:disabled,
input[readonly],
textarea:disabled,
textarea[readonly],
select:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

input[readonly],
textarea[readonly] {
    cursor: default !important;
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */
.login-page {
    background: linear-gradient(145deg, #eec3a4 0%, #ff6900 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 30px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 700;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group .input-group {
    display: flex;
    gap: 0;
    width: 100%;
}

.form-group .input-group input {
    flex: 1;
    border-radius: 6px 0 0 6px;
    min-width: 0;
    border-right-width: 1px;
    border-right-style: solid;
}

.form-group .input-group .btn {
    border-radius: 0 6px 6px 0;
    border: 1px solid #ddd !important;
    padding: 10px 12px;
    flex-shrink: 0;
    background-color: #fff;
    color: #666;
    border-left: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0693e3;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-group .input-group input:focus {
    border-color: #0693e3;
}

.form-group .input-group input:focus+.btn {
    border-color: #0693e3 !important;
}

.form-group input[inputmode="numeric"] {
    font-size: 16px;
    letter-spacing: 2px;
    text-align: center;
}



/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
    font-family: inherit !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
}

button.btn,
a.btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
    font-family: inherit !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
}

.btn-primary {
    padding: 0.375rem 0.75rem !important;
    background-color: #0693e3;
    color: white;
    border: 1px solid #0693e3 !important;
    border-radius: 6px;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.btn.btn-primary {
    padding: 0.375rem 0.75rem !important;
    background-color: #0693e3;
    color: white;
    border: 1px solid #0693e3 !important;
    border-radius: 6px;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.btn-outline-primary {
    padding: 0.375rem 0.75rem !important;
    background-color: transparent;
    color: #0693e3;
    border: 1px solid #0693e3 !important;
    border-radius: 6px;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer;
    transition: all 0.3s;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.btn-outline-primary:hover {
    background-color: #0693e3;
    color: white;
}

.btn-outline-secondary {
    padding: 0.375rem 0.75rem !important;
    background-color: transparent;
    color: #6c757d;
    border: 1px solid #6c757d !important;
    border-radius: 6px;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer;
    transition: all 0.3s;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.btn-outline-secondary:hover:not([disabled]) {
    background-color: #6c757d;
    color: white;
}

.btn-outline-secondary[disabled] {
    background-color: #6c757d;
    color: white;
    opacity: 0.65;
    cursor: not-allowed;
}

/* Match input-group buttons to form-control border */
.input-group .btn-outline-secondary {
    border-color: gray !important;
    color: #495057;
}

.input-group .btn-outline-secondary:hover:not([disabled]) {
    border-color: gray !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background-color: #046aa5;
}

.btn-login {
    width: 100%;
    padding: 10px;
    background-color: #0693e3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #0b88d0;
}

.btn-danger {
    padding: 9px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: top;
}

.btn-danger:hover {
    background-color: #c82333;
    text-decoration: none;
    color: white;
}

/* ========================================
   ALERT & MESSAGE STYLES
   ======================================== */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.info-box {
    background-color: #e7f3ff;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #0693e3;
    margin-bottom: 20px;
    border-left: 4px solid #0693e3;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #bee5eb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* ========================================
   BADGE STYLES
   ======================================== */

.status-badge {
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 6px;
}

.badge.bg-info {
    background-color: #d1ecf1 !important;
    color: #0c5460;
}

.badge.bg-success {
    background-color: #d4edda !important;
    color: #155724;
}

.badge.bg-danger {
    background-color: #f8d7da !important;
    color: #721c24;
}

.backup-codes {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */
nav.navbar {
    color: #ff6900 !important;
    box-shadow: 0 2px 5px #ff6900 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
}

.navbar {
    color: #ff6900 !important;
    box-shadow: 0 2px 5px #ff6900 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 22px;
}

.nav-link {
    margin-left: 10px;
    transition: color 0.3s;
}

.nav-link-border {
    margin-left: 10px;
    color: #0693e3 !important;
    border: 2px solid #0693e3 !important;
    border-radius: 6px;
}

.nav-link:hover {
    color: #0693e3 !important;
}

/* ========================================
   WELCOME SECTION STYLES
   ======================================== */
.welcome-section {
    margin-top: 30px;
    padding: 30px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.welcome-section h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
}

.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-card-sm {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #f28c28;
    max-height: 125px;
    transition: all 0.3s ease;
}

.detail-card-sm:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.detail-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #f28c28;
    transition: all 0.3s ease;
}

.detail-card:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.detail-card strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

/* ========================================
   CARD STYLES
   ======================================== */
.card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    color: black;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.card-header h4 {
    margin: 0;
    color: black;
    font-size: 18px;
}

.card-subheader {
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.card-subheader h6 {
    margin-bottom: 0;
    font-weight: 600;
    color: #333;
}

/* ========================================
   PAGINATION STYLES
   ======================================== */
.pagination {
    margin: 20px 0;
    gap: 5px;
}

.page-item {
    margin: 0;
}

.page-link {
    border: 1px solid #dee2e6;
    color: #626668;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.page-link:hover:not(.disabled) {
    background-color: #626668;
    color: white;
    border-color: #626668;
}

.page-item.active .page-link {
    background-color: #0693e3;
    border-color: #0693e3;
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    opacity: 0.5;
}

.card-body {
    padding: 20px;
}

/* ========================================
   2FA SETTINGS PAGE STYLES
   ======================================== */
.settings-page {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding-top: 30px;
}

.settings-page .container {
    max-width: 600px;
}

.qr-code-container {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin: 20px 0;
}

.qr-code-container img {
    max-width: 300px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

/* ========================================
   LINK STYLES
   ======================================== */
.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.signup-link a {
    color: #0693e3;
    text-decoration: none;
    transition: color 0.3s;
}

.signup-link a:hover {
    text-decoration: underline;
    color: #046aa5;
}

a.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

a.btn-primary {
    padding: 0.375rem 0.75rem;
    background-color: #0693e3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: top;
}

a.btn-primary:hover {
    background-color: #046aa5;
    color: white;
    text-decoration: none;
}

a.btn-secondary {
    padding: 9px;
    background-color: #6c757d;
    color: white;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: top;
}

a.btn-secondary:hover {
    background-color: #545b62;
    color: white;
    text-decoration: none;
}

a.btn-danger {
    padding: 9px;
    background-color: #dc3545;
    color: white;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: top;
}

a.btn-danger:hover {
    background-color: #c82333;
    color: white;
    text-decoration: none;
}


/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 768px) {
    .login-container {
        max-width: 90%;
    }

    .user-details {
        grid-template-columns: 1fr;
    }

    .nav-link {
        margin-left: 0;
        padding: 8px 0;
    }

    .qr-code-container img {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .login-container {
        padding: 20px;
    }

    .card-body {
        padding: 15px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .detail-card-sm,
    .detail-card {
        padding: 10px;
        overflow-x: auto;
    }

    .detail-card-sm canvas,
    .detail-card canvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 360px) {
    .container-wide {
        padding: 10px 15px;
    }

    .welcome-section {
        padding: 15px;
        margin-top: 15px;
    }

    .user-details {
        gap: 10px;
    }

    .detail-card-sm {
        padding: 8px;
        max-height: auto;
        font-size: 12px;
    }

    .detail-card-sm span {
        font-size: 36px !important;
    }

    .detail-card {
        padding: 8px;
        font-size: 12px;
    }

    .detail-card strong {
        font-size: 13px;
    }

    .detail-card canvas {
        max-height: 120px !important;
    }

    h2 {
        font-size: 16px;
    }
}

/* ========================================
   PROFILE PAGE STYLES
   ======================================== */

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #45b0ed 0%, #046aa5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto;
}

.profile-info p {
    margin-bottom: 0.5rem;
}

.profile-info small {
    display: block;
    color: #495057;
}

/* ========================================
   SUB MENU TAB STYLES
   ======================================== */
.nav-tabs .nav-link {
    color: #474748;
    background-color: tomato;
    border: 2px solid;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;

    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: white;
    background-color: whitesmoke;
}

.nav-tabs .nav-link.active {
    color: #6c757d;
    background-color: transparent;
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========================================
  GRID STYLES
   ======================================== */
.search-highlight {
    background-color: #5fc0f8;
    font-weight: 600;
    border-radius: 2px;
}

/* Colour circle indicator */
.colour-circle {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin-right: 8px;
    vertical-align: middle;
}

/* Action column - prevent button wrapping at any screen size */
table td.text-end {
    white-space: nowrap;
}

table td.text-end .btn {
    display: inline-block;
}

table td.text-end form {
    display: inline !important;
}

/* ========================================
   STATUS DATE ALERT STYLES
   ======================================== */
.row-status-date-alert {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.row-status-date-alert td {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* ========================================
   LOADING OVERLAY STYLES
   ======================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #0693e3;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}