/* === Reset & Body Styles === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f4f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Header, Navigation, Sidebar, Footer === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 20px;
    background-color: #194a7a;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 50px;
}
.logo { padding: 4px 0 0 10px; height: 40px; }
.header h1 { margin: 0; }
.links { display: flex; justify-content: flex-end; }
.links a { color: #fff; text-decoration: none; padding: 0px; }

aside {
    background-color: #476f95;
    color: #fff;
    width: 150px;
    position: fixed;
    top: 50px;
    bottom: 0;
    padding: 20px 10px;
    overflow-y: auto;
}
aside nav ul { list-style-type: none; padding: 0; margin: 0; }
aside nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px;
    display: block;
    font-size: 14px;
}
main {
    margin-top: 30px;
    margin-left: 170px;
    padding: 20px;
    flex-grow: 1;
    min-height: calc(100vh - 100px);
}
footer {
    text-align: center;
    padding: 1px 1px;
    background-color: #194a7a;
    color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 999;
}
.container {
    padding: 20px;
    max-width: 100%;
    position: relative;
}



/* Breadcrumbs *//* Breadcrumbs */
.breadcrumb {
    display: flex;                 /* full-width flex row */
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;                   /* span the full width of its parent */
    box-sizing: border-box;        /* include padding/border in width */
    font-size: 12px;               /* small text */
    line-height: 1.4;
    color: #475569;                /* slate-ish text */
    background: #f3f4f6;           /* light grey background */
    border: 1px solid #e5e7eb;     /* subtle border */
    padding: 8px 12px;             /* slight padding */
    border-radius: 6px;            /* soften edges */
    margin: 0 0 12px 0;
}

.breadcrumb__link {
    text-decoration: none;
    color: inherit;
}
.breadcrumb__link:hover {
    text-decoration: underline;
}
.breadcrumb__sep {
    opacity: 0.7;
}
.breadcrumb__current {
    font-weight: 600;
    color: #0f172a;                /* darker for current item */
}


.pager__link {
    text-decoration: none;
    font-size: 13px;
    color: #1e293b;
}

.pager__link:hover {
    text-decoration: underline;
}

.pager__link--right {
    margin-left: auto;
}

/* === END BREADCRUMB === */



/* === Table and Table Components === */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
table, th, td { border: 1px solid #ddd; }
th, td { padding: 12px; text-align: left; }
th {
    background-color: #476f95;
    color: #fff;
}
tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #f1f1f1; }
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-small {
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.table-small th { font-size:12px; padding: 10px; }
.table-small td {
    padding: 5px;
    text-align: left;
    font-size: 10px;
    word-wrap: break-word;
}
.table-small td input[type="text"],
.table-small td input[type="email"],
.table-small td input[type="number"],
.table-small td input[type="password"],
.table-small td input[type="datetime-local"] {
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}
.table-small th { word-wrap: break-word; }

.file-name { text-align: center; margin-bottom: 20px; font-size: 14px; color: #555; }
.file-row { cursor: pointer; }

/* === Voucher Styles (List Comps) === */
.voucher-ticket {
    display: inline-block;
    min-width: 150px;
    background: #f7f7f7;
    color: #194a7a;
    border-radius: 16px;
    border: 1.5px dashed #194a7a;
    padding: 6px 16px 4px 16px;
    font-family: 'Montserrat', 'Arial', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    position: relative;
    text-align: center;
    margin: 0 0 10px 12px;
    letter-spacing: 0.01em;
    overflow: hidden;
    line-height: 1.1;
    vertical-align: middle;
}
.voucher-ticket--compact {
    min-width: 110px;
    padding: 2px 10px 2px 10px;
    border-radius: 10px;
}
.voucher-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    gap: 0.4em;
}
.voucher-percent {
    font-size: 1.03em;
    font-weight: 700;
    color: #e77c17;
    margin-right: 0.2em;
    letter-spacing: 0.01em;
    line-height: 1.2;
    cursor:pointer;
}
.voucher-code {
    font-size: 1em;
    color: #194a7a;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.voucher-expiry {
    display: block;
    font-size: 0.82em;
    color: #555d6d;
    font-weight: normal;
    opacity: 0.85;
    text-align: center;
    margin-top: 1px;
    line-height: 1;
}

/* Voucher Modal/Groups */
#coupon-list-modal {
    animation: couponModalIn 0.18s cubic-bezier(.53,1.54,.34,1) both;
}
@keyframes couponModalIn {
    0% { opacity: 0; transform: scale(0.92) translate(-50%, -48%);}
    100% { opacity: 1; transform: scale(1) translate(-50%, -50%);}
}
#coupon-list-modal .coupon-list-item {
    margin-bottom: 16px;
    padding-bottom: 7px;
    border-bottom: 1px solid #4446;
}
#coupon-list-modal .coupon-list-item:last-child,
#coupon-list-modal .coupon-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
#coupon-list-modal .coupon-label {
    font-weight: bold;
    color: #fff;
}
#coupon-list-modal .coupon-code {
    background: #242627;
    color: #88f199;
    border-radius: 4px;
    padding: 2px 7px;
    font-family: monospace;
    margin-left: 0px;
    font-size: 1.5em;
}
#coupon-list-modal .coupon-discount {
    color: #4caf50;
    margin-left: 4px;
    font-size: .97em;
}
#coupon-list-modal .coupon-modal-title {
    font-size:1.12em;
    font-weight:600;
    letter-spacing:0.1em;
    margin-bottom:18px;
    color:#fff;
}
#coupon-list-modal button#coupon-modal-close:hover { color: #ffd25c; }
#coupon-list-modal .coupon-group {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #4446;
}

/* === Tooltip for Voucher Discount === */
#discount-tooltip { transition: opacity 0.14s; opacity: 0; }
#discount-tooltip.show { opacity: 1; pointer-events: auto; }
#discount-tooltip .voucher-code {
    background: #242627;
    color: #88f199;
    border-radius: 4px;
    padding: 2px 7px;
    font-family: monospace;
    margin-left: 4px;
    font-size: .99em;
}
#discount-tooltip .voucher-discount { color: #4caf50; margin-left: 6px; }
#discount-tooltip .voucher-expiry {
    display: block;
    color: #ffd25c;
    margin-top: 4px;
    font-size: .98em;
}

//* === List Comps, Table, and DataTables Overrides === */

.list-comps {
    margin: 0;
    width: 100%;
    overflow-x: auto; /* just in case */
}

.list-comps table {
    width: 100%;
    font-size: 13px;
    background: #fff;
    border-collapse: collapse;
    table-layout: auto; /* let browser handle column widths */
}

.list-comps th,
.list-comps td {
    padding: 1px 8px;
    border: none;
    vertical-align: middle;
}

.list-comps th:first-child,
.list-comps td:first-child {
    min-width: 130px;
    max-width: 320px;
    width: 60vw;            /* allow wide, but will shrink */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.list-comps th:not(:first-child),
.list-comps td:not(:first-child) {
    min-width: 35px;
    max-width: 110px;
    width: 1%;
    white-space: nowrap;
    text-align: center;
}


/* Misc styles */
.list-comps a { text-decoration: none; }
.list-comps a:visited { text-decoration: none; color: #000068; }
.list-comps .discount-icon,
.list-comps .outlink-icon {
    vertical-align: middle;
    width: 0.8em;
    height: 0.8em;
    margin-left: 8px;
}
.list-comps .btn {
    display: inline-block;
    margin: 0 5px 15px 5px;
    padding: 4px 6px;
    background-color: #194a7a;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    text-decoration: none;
}
.list-comps .btn:hover { background-color: #0056b3; }
.list-comps .table-footer { text-align: left; margin-top: 6px; }
.list-comps .small-count { font-size: 0.8em; color: #666; }

/* DataTables tweaks */
.dataTables_wrapper .dataTables_filter input {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 14px;
    border-radius: 4px;
    margin: 0 2px;
}
.dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    top: 0; left: 0;
    width: auto;
    display: flex;
    align-items: flex-end;
}
.dataTables_filter input[type="search"] {
    border: 1.5px solid #ddd;
    border-radius: 10px 10px 0 0;
    padding: 6px 14px;
    font-size: 1em;
    background: #f7f7f7;
    color: #888;
    box-shadow: 0 -2px 10px rgba(25,74,122,0.06);
    outline: none;
    margin-left: 2px;
    margin-right: 0;
    margin-bottom: -2px;
    box-sizing: border-box;
}
.dataTables_paginate, .dataTables_length, .dataTables_info {
    display: none !important;
}


/* === View Competitions Page === */

/* timeframes for view-comps*/
.time-range-row {
    display: flex;
    flex-wrap: nowrap;           /* Don't allow wrapping */
    justify-content: flex-start; /* Left-align for scrolling */
    gap: 8px;
    margin-bottom: 1em;
    max-width: 600px;            /* Or 100% if you want full width on mobile */
    overflow-x: auto;            /* Allow horizontal scroll if content overflows */
    -webkit-overflow-scrolling: touch; /* Smoother scrolling on iOS */
    scrollbar-width: thin;       /* Optional: smaller scrollbar on Firefox */
}


.time-range-link {
    flex: 1 1 0;
    min-width: 40px;
    max-width: 80px;
    text-align: center;
    background: #f5f5f5;
    color: #222;
    border-radius: 6px;
    padding: 3px 1px;
    margin: 0;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    font-size: .7em;
}
.time-range-link.selected,
.time-range-link:focus,
.time-range-link:hover {
    background: #223366;
    color: #fff;
    font-weight: bold;
}
/* end timeframes */






/* === Floating Success/Error Messages === */
.message-success, .message-error {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
    max-width: 400px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    animation: slideIn 0.5s forwards;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.dismiss-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: inherit;
    cursor: pointer;
    margin-left: 10px;
}
.dismiss-btn:hover { color: #000; opacity: 0.8; }
.dismiss-btn:active { transform: scale(0.95); }
.hidden { display: none; }

/* === Form, Button, and Utility Classes === */
.form-button {
    padding: 10px 20px;
    background-color: #194a7a;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    z-index: 1000;
    text-align: left;
    margin: 0 0 20px 10px;
}
.form-button:hover { background-color: #0056b3; }
.form-container, .result-container {
    margin-bottom: 20px;
    text-align: center;
}
.form-container form, .result-container form {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}
.form-container .radio-group, .result-container .radio-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.form-container label, .result-container label {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.form-container input[type="radio"]:checked + label, .result-container input[type="radio"]:checked + label {
    background-color: #194a7a;
    color: #fff;
    border-color: #194a7a;
}
.form-container button, .result-container button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #194a7a;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    margin: auto;
}
.form-container button:hover, .result-container button:hover {
    background-color: #0056b3;
}

/* === Responsive (Mobile) Styles === */
@media (max-width: 850px) {
    #discount-tooltip { display: none !important; }
    .table-small th, .table-small td { padding: 0.25em 0.5em; font-size: 0.875rem; }
    .header {
        display: flex; align-items: center; justify-content: flex-start;
        padding: 0 10px; position: fixed; top: 0; left: 0; right: 0; height: 50px; width: 100%;
    }
    .header > a { flex: 1 1 auto; min-width: 0; }
    .header h1 { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .links { display: flex; align-items: center; flex: 0 0 auto; margin: 0 20px; }
    .links span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80vw; }
    aside { position: static; width: 100%; padding: 10px; margin-top: 50px; height: auto; }
    main { margin-top: 10px; margin-left: 0; }
    footer { position: relative; }

    .list-comps {
        width: 100%;
        max-width: 100%;
        padding: 0 0px; /* Adds margin on both sides for mobile */
        overflow-x: auto;
        box-sizing: border-box;
    }
    .list-comps table {
        width: 98%;
        max-width: 98%;
        table-layout: fixed;
    }
    .list-comps th,
    .list-comps td {
        font-size: 10px;
        padding: 4px 2px;
    }
    .list-comps th:first-child,
    .list-comps td:first-child {
        width: auto;
        min-width: 130px;
        max-width: 350px;
        white-space: normal;
        word-break: break-word;
    }
    .list-comps th:not(:first-child),
    .list-comps td:not(:first-child) {
        width: 1%;
        min-width: 16px;
        max-width: 34px;
       /* white-space: nowrap; */
        text-align: center;
    }


.dataTables_wrapper .dataTables_filter input {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #ccc;
}
.dataTables_filter input[type="search"] {
    border: 1.5px solid #ddd;
    border-radius: 10px 10px 0 0;
    padding: 4px 7px;
    font-size: 0.7em;
    box-shadow: 0 -1px 5px rgba(25,74,122,0.06);
    margin-left: 4px;
    margin-right: 0;
    margin-bottom: -2px;
}


}
