/* Support page specific styles */

/* Custom wide container for support pages */
.support-wide-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Container with 90% width for support pages */
.support-container-90 {
    max-width: 90%;
    margin: 0 auto;
}

/* Bootstrap-like utility classes for support pages */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

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

.d-flex {
    display: flex !important;
}

.d-inline {
    display: inline !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

@media (min-width: 1400px) {
    .support-wide-container {
        max-width: 1350px;
    }
}

@media (min-width: 1600px) {
    .support-wide-container {
        max-width: 1550px;
    }
}

/* General table styles */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table tbody + tbody {
    border-top: 2px solid #dee2e6;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Make tables wider and more responsive */
.support-users-table {
    width: 100%;
    min-width: 1200px; /* Ensure minimum width for proper column spacing */
    table-layout: auto; /* Let columns size dynamically */
}

.support-users-table th,
.support-users-table td {
    white-space: nowrap; /* Prevent text wrapping in table cells */
    padding: 12px 8px; /* Better padding for readability */
    vertical-align: middle;
}

/* Email column should be wider */
.support-users-table th:nth-child(1),
.support-users-table td:nth-child(1) {
    min-width: 280px;
    max-width: 350px;
    word-break: break-all; /* Allow breaking long email addresses if needed */
}

/* Name column */
.support-users-table th:nth-child(2),
.support-users-table td:nth-child(2) {
    min-width: 200px;
    max-width: 300px;
}

/* Status and Migration badges */
.support-users-table th:nth-child(3),
.support-users-table td:nth-child(3),
.support-users-table th:nth-child(4),
.support-users-table td:nth-child(4) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* Last login column */
.support-users-table th:nth-child(5),
.support-users-table td:nth-child(5) {
    min-width: 150px;
    max-width: 180px;
}

/* Actions column */
.support-users-table th:nth-child(6),
.support-users-table td:nth-child(6) {
    min-width: 120px;
    width: 120px;
    text-align: center;
}

/* Ensure table container can scroll horizontally */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Button styling fixes - ONLY for Bootstrap-style buttons in support containers */
/* These styles should NOT affect the site's primary btn--primary and btn--secondary classes */
.support-container-90 .btn-primary,
.support-wide-container .btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-primary:hover,
.support-wide-container .btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

.support-container-90 .btn-success,
.support-wide-container .btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-success:hover,
.support-wide-container .btn-success:hover {
    background-color: #1e7e34 !important;
    border-color: #1e7e34 !important;
}

.support-container-90 .btn-warning,
.support-wide-container .btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-warning:hover,
.support-wide-container .btn-warning:hover {
    background-color: #e0a800 !important;
    border-color: #e0a800 !important;
}

.support-container-90 .btn-danger,
.support-wide-container .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-danger:hover,
.support-wide-container .btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
}

.support-container-90 .btn-info,
.support-wide-container .btn-info {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-info:hover,
.support-wide-container .btn-info:hover {
    background-color: #117a8b !important;
    border-color: #117a8b !important;
}

.support-container-90 .btn-secondary,
.support-wide-container .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out;
}

.support-container-90 .btn-secondary:hover,
.support-wide-container .btn-secondary:hover {
    background-color: #545b62 !important;
    border-color: #545b62 !important;
}

/* Table buttons - keep normal size for better visibility */
.support-users-table .btn-info,
.support-users-table .btn-primary,
.support-users-table .btn-secondary,
.support-users-table .btn-success,
.support-users-table .btn-warning,
.support-users-table .btn-danger {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Better spacing for button groups */
.btn-group {
    margin-right: 0.5rem;
}

.btn-group .btn {
    margin-right: 0;
}

/* Card improvements for better structure */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Badge improvements */
.badge {
    font-size: 0.875em;
    padding: 0.375em 0.75em;
}

.badge-success {
    background-color: #28a745 !important;
    color: white !important;
}

.badge-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Form improvements */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #007bff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
}

.text-muted {
    color: #6c757d !important;
}

/* Alert improvements */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Modal styles - Bootstrap-like modal functionality without Bootstrap */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent backdrop */
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.modal-title {
    margin: 0;
    line-height: 1.5;
    font-size: 1.25rem;
}

.modal-header .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

.modal-header .close:hover {
    opacity: 0.75;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.modal-footer > * {
    margin: 0.25rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .support-users-table {
        min-width: auto;
        font-size: 0.875rem;
    }
    
    .support-users-table th,
    .support-users-table td {
        padding: 8px 4px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
    }
}
