/* AffiliateAdmin Modern Styles - Bootstrap 5 based */
/* Ported from legacy styles.css custom AffiliateAdmin section */

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    --arn-primary: #0072ce;
    --arn-primary-hover: #0060ad;
    --arn-secondary: #6c757d;
    --arn-success: #19bb19;
    --arn-danger: #dc3545;
    --arn-warning: #ffc107;
    --arn-bg-body: #ebf1f3;
    --arn-bg-section: #ffffff;
    --arn-border-color: #dee2e6;
    --arn-text-color: #333;
    --arn-text-muted: #555;
    --arn-font-family: "Open Sans", Helvetica, sans-serif;
    --arn-shadow: 0 0 3px rgba(0,0,0,.2);
    --arn-shadow-card: 0 1px 3px rgba(0,0,0,.08);
}

/* ============================================
   Global / Body
   ============================================ */
body {
    background-color: var(--arn-bg-body);
    font-family: var(--arn-font-family);
    font-size: 14px;
    font-weight: normal;
    color: var(--arn-text-color);
    line-height: 1.4em;
}

/* ============================================
   Cards / Sections
   ============================================ */
.card {
    border-radius: 0.5rem;
    box-shadow: var(--arn-shadow-card);
    margin-bottom: 1rem;
    background-color: var(--arn-bg-section);
}
.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--arn-border-color);
    font-weight: 600;
}

/* ============================================
   Headings
   ============================================ */
h1, h2, h3, h4, h5 {
    color: var(--arn-text-muted);
    font-weight: 500;
}
h1 { font-size: 1.4em; }
h2 { font-size: 1.2em; font-weight: bold; margin: 12px 0 10px 0; }

/* ============================================
   Tables (replaces DataGrid styling)
   ============================================ */
.table-responsive {
    border-radius: 0.375rem;
    overflow-x: auto;
    border-right: 3px solid #ddd;
}
@media (min-width: 1500px) {
    .table-responsive { border-right: none; }
}
.table thead th {
    font-weight: 600;
    white-space: nowrap;
    padding: 0.625rem 0.75rem;
}
.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}
.table tbody td {
    white-space: nowrap;
    padding: 10px;
    font-weight: normal;
    vertical-align: middle;
}
table tr.table-header td {
    color: black;
    font-weight: bold;
    border-top: 1px solid #ddd;
}

/* ============================================
   Forms
   ============================================ */
.form-control:focus, .form-select:focus {
    border-color: var(--arn-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 114, 206, 0.25);
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}
input, select {
    height: 40px;
    padding: 5px;
}
input[type=radio], input[type=checkbox] {
    width: initial;
    height: initial;
}
select {
    padding: 5px;
    height: 40px;
}
.required, .text-danger {
    color: red;
}

/* ============================================
   Buttons (replaces GIF buttons)
   ============================================ */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease-in-out;
}
.btn-primary {
    background-color: var(--arn-primary);
    border-color: var(--arn-primary);
}
.btn-primary:hover {
    background-color: var(--arn-primary-hover);
    border-color: var(--arn-primary-hover);
}

/* ============================================
   Search Options
   ============================================ */
.search-options input {
    min-width: 150px;
    transition: all 0.5s ease;
}
.search-options input:focus {
    min-width: 300px;
}
.search-options input[type='checkbox'] {
    min-width: initial;
    margin: 0 5px;
}
@media (max-width: 1000px) {
    .search-options input { min-width: 100%; margin: 10px 0; }
    .search-options select { min-width: 100%; }
}

/* ============================================
   Login / Anonymous Pages
   ============================================ */
.anonymous-page {
    background-color: var(--arn-primary);
    min-height: 100vh;
}
.anonymous-page .card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 50px auto 0;
    padding: 25px;
}
.anonymous-page footer {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Navbar / Header (replaces fixed left nav)
   ============================================ */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header-logo {
    max-height: 40px;
    width: auto;
}
.nav-link {
    transition: all 0.3s ease-out;
}
.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ============================================
   Detail Pages (Affiliate, Master, Site, etc.)
   ============================================ */
.details label {
    display: block;
}
.details div {
    vertical-align: top;
}
.details input, .details select, .details textarea {
    width: 100%;
}
.activation-date, .deactivation-date {
    background-color: #f1f1f1;
    margin: 10px 0 0;
    padding: 10px;
    border-radius: 0.375rem;
}

/* ============================================
   Reservation Page
   ============================================ */
.reservation-totals td:first-child {
    background: #F1F1F1;
    text-align: right;
    font-weight: bold;
}
.revenue {
    color: var(--arn-success);
}

/* ============================================
   Error / Success Messages
   ============================================ */
.alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
ul.error, ul.success {
    background-color: red;
    color: white;
    padding: 10px;
    list-style: none;
    border-radius: 0.375rem;
}
ul.success {
    background-color: var(--arn-success);
}

/* ============================================
   Pagination
   ============================================ */
.pagination .page-link {
    color: var(--arn-primary);
}
.pagination .page-item.active .page-link {
    background-color: var(--arn-primary);
    border-color: var(--arn-primary);
    color: #fff;
}

/* ============================================
   Footer
   ============================================ */
footer {
    margin-top: auto;
    padding: 1rem 0;
}

/* ============================================
   Commission Details Page
   ============================================ */
.commissiondetails .search-options label {
    display: block;
    margin: 0;
}

/* ============================================
   User Management Pages
   ============================================ */
.user .display-deactivated-users label,
.user .display-deactivated-users input {
    width: initial;
    display: inline-block;
}

/* ============================================
   Support Page
   ============================================ */
section.support div label,
section.support div input,
section.support div textarea {
    display: block;
    width: 100%;
}

/* ============================================
   Settings Page
   ============================================ */
.settings .inactive-setting {
    opacity: 0.5;
}

/* ============================================
   Logo Upload
   ============================================ */
.busyContainer {
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
    padding: 5% 0;
    background-color: rgba(255,255,255,.75);
    height: 100%;
    display: none;
}
.progress .busyContainer { display: block; }

/* ============================================
   Change Log
   ============================================ */
.changelog {
    overflow: hidden;
}

/* ============================================
   Flatpickr Custom Styles
   ============================================ */
.flatpickr-input {
    background-color: #fff !important;
}

/* ============================================
   Sort Indicators
   ============================================ */
.text-white.text-decoration-none:hover {
    text-decoration: underline !important;
}

/* ============================================
   Button Groups in Tables
   ============================================ */
td .btn-group .btn {
    white-space: nowrap;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .table-responsive { font-size: 0.875rem; }
    .card-body { padding: 1rem; }
    .btn { width: 100%; margin: 5px 0; }
    .btn-group .btn { width: auto; }
}

@media (max-width: 576px) {
    .navbar-brand img { max-height: 30px; }
    h2 { font-size: 1.1em; }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar, .btn-group, footer { display: none !important; }
    .table thead th { background-color: #eee !important; color: #000 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
