/* ==================================================================== */
/*  Universal CSS for All Pages - Desktop & Mobile Friendly             */
/* ==================================================================== */

/* ------------------ Root Variables ------------------ */
:root {
    --primary-blue: #007BFF;
    --dark-blue: #0056b3;
    --black: #000000;
    --light-grey: #f5f5f5;
    --white: #ffffff;
    --highlight-red: #cb0c1f;
    --highlight-green: #28a745;
}

/* ------------------ Reset and Base ------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #89f7fe, #66a6ff);
    overflow-x: hidden;
    animation: backgroundAnimation 10s infinite alternate ease-in-out;
    min-height: 100vh;
}

@keyframes backgroundAnimation {
    0% { background-position: left; }
    100% { background-position: right; }
}

main {
    animation: fadeInMain 1.5s ease;
}

@keyframes fadeInMain {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ------------------ Animations ------------------ */
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes floatText {
    from { transform: translateY(0); }
    to { transform: translateY(8px); }
}

@keyframes subtlePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------------ Typography ------------------ */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.Title {
    color: var(--dark-blue);
    margin-bottom: 2.5rem;
    text-align: center;
    margin-top: 2.5rem;
    text-decoration: underline;
    font-weight: bold;
}

/* ------------------ Buttons ------------------ */
button, .button, .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    border: none;
    background-color: var(--primary-blue);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem 0;
}

button:hover, .button:hover, .btn:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-primary { background-color: var(--primary-blue); color: var(--white); }
.btn-secondary { background-color: var(--light-grey); color: var(--black); }
.btn-success { background-color: var(--highlight-green); }
.btn-danger { background-color: var(--highlight-red); }

.button-secondary:hover { background-color: #e0e0e0; }
.button-danger:hover { background-color: #a00; }
.button-success:hover { background-color: #218838; }

.back-link, .back-button, .cta-button, .cta-buttons a {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    transition: background 0.25s, transform 0.15s;
}

.back-link:hover, .back-button:hover, .cta-button:hover, .cta-buttons a:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

/* ------------------ Forms ------------------ */
input[type="text"],
input[type="tel"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin: 0.5rem 0;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-blue);
    outline: none;
}

#livesearch {
	max-height: 200px;
	overflow-y: auto;
	background: white;
	position: absolute;
	width: 100%;
	max-width: 360px;
	z-index: 200;
	border-radius: 10px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.1);
	animation: fadeIn 0.5s ease;
}

#livesearch div {
	padding: 10px;
	cursor: pointer;
	transition: background 0.3s;
}

#livesearch div:hover {
	background: #f1f1f1;
}

@keyframes fadeInResult {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.search-result-item {
	padding: 10px;
	border-bottom: 1px solid #ccc;
	cursor: pointer;
	opacity: 0;
	animation: fadeInResult 0.3s ease-out forwards;
}
.search-result-item:hover {
	background-color: #f0f0f0;
}

/* ------------------ Tables ------------------ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: bold;
}

tr:hover {
    background-color: var(--light-grey);
}

.table-container, .table-wrapper {
    overflow-x: auto;
}

/* ------------------ Cards ------------------ */
.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.card-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ------------------ Messages ------------------ */
.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 5px;
    color: var(--white);
    z-index: 1000;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.message-container.success { background-color: var(--highlight-green); }
.message-container.error { background-color: var(--highlight-red); }

/* ------------------ Status Chips ------------------ */
.alert, .error, .success, .info-message, .error-message, .closed-notice {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    color: var(--white);
    margin: 1rem 0;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.alert-success, .success { background: var(--highlight-green); }
.alert-error, .error, .error-message { background: var(--highlight-red); }
.info-message, .closed-notice { background: var(--primary-blue); }

.status-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.status-icon.success  { color: var(--highlight-green); }
.status-icon.error    { color: var(--highlight-red); }
.status-icon.pending  { color: var(--primary-blue); }

/* ------------------ Modals / Tutorial ------------------ */
.modal, .tutorial-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.modal.active, .tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content, .tutorial-content {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    max-width: 90%;
    width: 520px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: fadeInMain 0.4s;
}

/* ------------------ Progress / Countdown ------------------ */
.progress {
    background: #e9ecef;
    border-radius: 50px;
    overflow: hidden;
    height: 1rem;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--highlight-green);
    transition: width 0.4s ease;
    border-radius: inherit;
}

.countdown, .numbers-display, .number-display {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    font: 700 1.2rem/1 'Roboto', sans-serif;
}

.countdown-item {
    background: var(--white);
    padding: 1rem;
    border-radius: 10px;
    min-width: 60px;
}

/* ------------------ Loading States ------------------ */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after, .loading-spinner {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--primary-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ------------------ Sections ------------------ */
section {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--white);
    margin: 30px 15px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    opacity: 1;
    transition: all 0.8s ease-out;
}

section.active {
    transform: translateY(0);
    opacity: 1;
}

section h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 2rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature {
    background-color: var(--light-grey);
    padding: 20px;
    border-radius: 12px;
    transition: transform 0.4s, box-shadow 0.4s;
    animation: subtlePulse 5s infinite alternate;
}

.feature:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ------------------ Call to action buttons ------------------ */
.cta-buttons {
    margin-top: 40px;
}

.cta-buttons a, .button-group button {
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 30px;
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: bold;
    margin: 10px;
    display: inline-block;
    transition: background-color 0.3s, transform 0.2s;
    cursor: pointer;
}

.cta-buttons a:hover, .button-group button:hover {
    background-color: var(--dark-blue);
    transform: scale(1.05);
}

.button-group {
    margin-top: 30px;
}

/* ------------------ Footer ------------------ */
footer {
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* ------------------ Header ------------------ */
header {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--white);
    padding: 30px 20px;
    text-align: center;
    animation: slideDown 1s ease-out forwards;
}

header h1 {
    font-size: 2.8rem;
    color: var(--white);
    margin-bottom: 10px;
    animation: floatText 3s ease-in-out infinite alternate;
}

header i {
    font-size: 1.3rem;
    opacity: 0.9;
}

.header-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.header-button {
    z-index: 1;
    display: inline-block;
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 20px;
    background-color: var(--white);
    color: var(--primary-blue);
    font-weight: bold;
    border: 2px solid var(--primary-blue);
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.header-button:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .header-buttons {
        top: 10px;
        right: 20%;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    header p {
        font-size: 1.1rem;
    }
}

/* ------------------ Print ------------------ */
@media print {
    body { background: none !important; animation: none !important; }
    .sideNav, .message-container, .menu-toggle { display: none !important; }
    section, .card, .alert { box-shadow: none !important; }
}

/* ------------ Tutorial Styles ------------- */
.tutorial-box {
    position: absolute;
    max-width: 300px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 0 8px rgba(0,0,0,0.7);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.tutorial-box button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 10px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.tutorial-box button:hover {
    background: #0056b3;
}

.tutorial-box.hidden { opacity: 0; pointer-events: none; }
.tutorial-box.visible { opacity: 1; }

/* -------------- CSV input fields ------------*/
.chips-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    cursor: text;
	height: auto;
	min-height: 45px;
}

.chips {
    display: contents;
    gap: 4px;
}

.chips .chip {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
	margin: 2px;
	white-space: nowrap;
}

.chips .chip span {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
}

#chipEntry {
     border: none;
     border-top: 1px solid #ccc;
     width: 100%;
     outline: none;
     order: 99; /* Forces the input to the end of the flex container */
     padding: 6px;
     font-size: 14px;
 	 margin-top: 8px;
 	 flex-basis: 100%;
}

.chips .chip button {
	background: none;
	border: none;
	color: white;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	margin-left: 4px;
	line-height: 1;
	padding: 0;
}

/* --- Main Card Styling --- */
/* This targets your existing div with the 'session' class */
.session {
    display: block; /* Override any other display properties */
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative; /* Required to position the close button */
}

/* --- Close Button --- */
/* Targets the <a class='fa fa-close'> tag */
.session > .fa.fa-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 1.2em;
    color: #a0a0a0;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.session > .fa.fa-close:hover {
    color: #ff4d4d;
}

/* --- Labels --- */
/* Styles all labels within the card */
.session label {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    margin-top: 12px;
    /* Add space above labels to create vertical separation */
    display: inline-block;
    margin-top: 12px;
}

/* --- Input Fields --- */
/* Targets all text and time inputs for a consistent look */
.session input[type="text"],
.session input[type="time"] {
    width: 100%;
    padding: 8px 10px;
    margin-top: 5px; /* Space between label and input */
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Prevents padding from breaking layout */
    font-size: 0.95em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Adds a nice focus indicator to inputs */
.session input[type="text"]:focus,
.session input[type="time"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* --- Section-Specific Adjustments --- */
/* Activity Type: Make the radio button labels look clean */
.session .activity-type > label {
    margin-top: 8px;
    font-weight: normal; /* Radio option text shouldn't be bold */
}
