/**
 * user_access.css - Styling cho trang quản lý truy cập và popup xác thực
 */

/* Container & Header */
.access-management-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.section-header {
    margin-bottom: 35px;
    position: relative;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: #356DF1;
}

.section-subtitle {
    color: #6c757d;
    margin-top: 8px;
    font-size: 15px;
}

/* Device Cards */
.device-card {
    display: flex;
    align-items: center;
    padding: 24px;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    margin-bottom: 20px;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    border-color: #356DF1;
}

.device-card.current-device {
    background: linear-gradient(to right, #f0f5ff, #ffffff);
    border-left: 5px solid #356DF1;
}

.device-card.pending-card {
    background: linear-gradient(to right, #fffdf8, #ffffff);
    border-left: 5px solid #ffc107;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        border-left-color: #ffc107;
    }

    50% {
        border-left-color: #ffd970;
    }

    100% {
        border-left-color: #ffc107;
    }
}

.device-icon {
    width: 64px;
    height: 64px;
    background: #f7fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #a0aec0;
    margin-right: 24px;
    flex-shrink: 0;
}

.current-device .device-icon {
    background: #eff6ff;
    color: #356DF1;
}

.pending-card .device-icon {
    background: #fffaf0;
    color: #ffc107;
}

.device-details {
    flex-grow: 1;
}

.device-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #718096;
}

.device-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.device-meta i {
    width: 14px;
    opacity: 0.8;
}

.device-ua {
    margin-top: 8px;
    font-size: 13px;
    color: #a0aec0;
    font-family: inherit;
}

/* Action Buttons */
.device-actions {
    margin-left: 20px;
}

.btn-approve {
    background: #48bb78;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-approve:hover {
    background: #38a169;
    transform: scale(1.05);
}

.btn-remove {
    transition: all 0.2s;
}

.btn-remove:hover {
    transform: scale(1.05);
}

/* Progress Section */
.device-limit-card {
    border: none;
    background: #fdfdfd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.progress {
    background: #edf2f7;
    overflow: visible;
}

.progress-bar {
    border-radius: 10px;
    position: relative;
    transition: width 0.6s ease;
}

/* Modal Styling */
#deviceVerifyModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}

#deviceVerifyModal .nav-pills .nav-link {
    border-radius: 8px;
    font-weight: 600;
    color: #718096;
    padding: 10px;
}

#deviceVerifyModal .nav-pills .nav-link.active {
    background: #356DF1;
    color: #fff;
}

#otpCode:focus {
    box-shadow: none;
    border-color: #356DF1;
}

.tab-pane {
    min-height: 250px;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .access-management-content {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .device-card {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .device-icon {
        margin-right: 0;
        margin-bottom: 16px;
    }

    .device-meta {
        justify-content: center;
        gap: 12px;
    }

    .device-actions {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .section-title {
        font-size: 20px;
    }
}

/* ==========================================
   Custom Modal for Device Verification
   (Without Bootstrap)
   ========================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Body */
.modal-body-custom {
    padding: 32px;
    text-align: center;
}

/* Icon */
.modal-icon {
    font-size: 56px;
    color: #356DF1;
    margin-bottom: 16px;
}

/* Headings */
.modal-title-custom {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 12px;
}

.modal-subtitle {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Buttons */
.btn-modal-primary {
    background: #356DF1;
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-primary:hover {
    background: #000000;
    transform: translateY(-1px);
}

.btn-modal-outline {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    text-align: left;
    color: #1F2937;
}

.btn-modal-outline:hover {
    border-color: #356DF1;
    background: #f9fafb;
}

.btn-modal-outline.selected {
    border-color: #356DF1;
    background: #eff6ff;
}

/* Radio option styling */
.radio-option {
    position: relative;
    padding-left: 40px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    accent-color: #356DF1;
}

.radio-option .option-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6B7280;
}

.radio-option:hover .option-icon {
    background: #e5e7eb;
    color: #356DF1;
}

.btn-modal-outline i {
    font-size: 20px;
}

.btn-modal-link {
    background: none;
    border: none;
    color: #6c757d;
    padding: 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn-modal-link:hover {
    color: #356DF1;
}

/* Form Inputs */
.form-label-custom {
    display: block;
    text-align: left;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input-custom {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
    color: #1F2937;
}

.form-input-custom:focus {
    outline: none;
    border-color: #356DF1;
    box-shadow: 0 0 0 3px rgba(53, 109, 241, 0.1);
}

/* Alert */
.alert-custom {
    background: #eff6ff;
    color: #1e40af;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
}

.alert-custom i {
    margin-right: 6px;
}

/* Spinner */
.spinner-custom {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ffc107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* OTP Input */
.otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 12px;
    padding: 16px;
}

/* Utility */
.d-none-custom {
    display: none !important;
}

.d-flex-custom {
    display: flex !important;
    flex-direction: column;
}

/* Form section container */
#emailInputStep,
#otpInputStep {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-warning-custom {
    color: #ffc107 !important;
}

.text-primary-custom {
    color: #356DF1 !important;
}

.text-success-custom {
    color: #48bb78 !important;
}

.mb-0-custom {
    margin-bottom: 0 !important;
}

.mb-2-custom {
    margin-bottom: 8px !important;
}

.mb-3-custom {
    margin-bottom: 16px !important;
}

.mb-4-custom {
    margin-bottom: 24px !important;
}

.w-100-custom {
    width: 100% !important;
}

.d-grid-custom {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
}

.gap-2-custom {
    gap: 12px !important;
}

/* Radio option container */
.radio-option {
    position: relative;
    padding: 16px 16px 16px 48px;
    cursor: pointer;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #356DF1;
    background: #f9fafb;
}

.radio-option.selected {
    border-color: #356DF1;
    background: #eff6ff;
}

.radio-option input[type="radio"] {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    accent-color: #356DF1;
    margin: 0;
}

.radio-option .option-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6B7280;
    flex-shrink: 0;
}

.radio-option:hover .option-icon {
    background: #e5e7eb;
    color: #356DF1;
}

/* Mobile */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        margin: 16px;
    }
    
    .modal-body-custom {
        padding: 24px;
    }
}

/* Password Modal Additional Styles */
.form-control-custom {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #fff;
}

.form-control-custom:focus {
    outline: none;
    border-color: #356DF1;
    box-shadow: 0 0 0 3px rgba(53, 109, 241, 0.1);
}

.form-control-custom.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback-custom {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.invalid-feedback-custom.show {
    display: block;
}

.btn-modal-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-secondary:hover {
    background: #5a6268;
}

.btn-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
}

.btn-modal-close:hover {
    color: #1f2937;
}

.modal-footer-custom {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}