/*setting colour variables*/
:root {
  --red: #802f2f;
  --white: #fffcf2;
  --deepred: #160404;
  --blue: #88BDDA;
  --base-variant: #fffcf2
}

.darkmode{
--red: #802f2f;
--white: #fffcf2;
--deepred: #160404;
--blue: #88BDDA;
--background: #160404;
--textcolor: #fffcf2;
}

#theme-switch{
    height: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
    background-color: var(--base-variant);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 20px;
    right: 20px;
       
}



#theme-switch svg{
    fill: var(--primary-color);

}

#theme-switch svg:last-child{
    display:none;
}
.darkmode #theme-switch svg:first-child{
    display:none;
}
.darkmode #theme-switch svg:last-child{
    display:block;
}

* {
    font-family: 'Poppins';
}

body {
    margin: 0;
    background: var(--background);
    color: var(--textcolor); 
}
/*Header styling*/
header {
    text-align: left;
    color: var(--white);
    font-size: 25px;

    background: var(--red);
    
    width: 100%;
    padding: 20px;
    
    box-sizing: border-box;
}


/*Nav styling*/
nav {
    background: var(--deepred);

    text-align: left;
    word-spacing: 20px;
    font-size: larger;
    color: var(--white);

    width: 100%;
    padding: 10px 20px 10px 20px;

    box-sizing: border-box;
}

nav a {
    text-decoration: none;
    color: var(--white);
}

nav a:hover {
    color: var(--blue);
}

/* Ensure injected statistics link matches nav links */
nav a.statistics-link {
    text-decoration: none;
    color: var(--white);
}

nav a.statistics-link:hover {
    color: var(--blue);
}

/*content styling*/
.content {
    padding: 20px;
}



/*Footer styling*/
footer {
    text-align: left;
    background: var(--red);
    color: var(--white);

    padding: 20px;

}

footer .contact_list {
    list-style-type: none;
    padding: 0;
}


/*login/register page styling*/

/*login/register form*/
.login_form {

    box-shadow: var(--deepred) 0px 5px 15px;
    border-radius: 10px;
    padding: 20px 50px 50px 50px;

    display: flex;
    flex-direction: column;
    width: 400px;

    margin: 50px auto 50px auto;
}

.login_form h3, .login_form div {
    margin-bottom: 20px;
}

.login_form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login_form input[type="text"], 
.login_form input[type="email"], 
.login_form input[type="tel"], 
.login_form input[type="password"] {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.2;
}

.login_form button {
    margin-top: 15px;
    width: 35%;
}

/*Forgot password styling*/
.forgot-password-section {
    margin-top: 15px;
    text-align: center;
}

.forgot-password-link {
    color: var(--deepred);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: var(--red);
}

/*Admin login styling*/
.admin-login-section {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.admin-toggle-btn {
    background: white;
    color: black;
    border: none;
    padding: 6px 50px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    width: auto;
    min-width: 200px;
    justify-content: center;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    height: 32px;
}

.admin-toggle-btn:hover {
    background: var(--red);
}

.arrow-down {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.admin-login-dropdown {
    display: none;
    margin-top: 15px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.admin-form div {
    margin-bottom: 15px;
    text-align: left;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--deepred);
}

.admin-form input[type="email"],
.admin-form input[type="password"] {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.2;
}

.admin-form button {
    background: #ccc;
    color: black;
    border: 1px solid black;
    padding: 6px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    height: 32px;
}

.admin-form button:hover {
    background: var(--red);
}

/*Password field styling*/
.password-field {
    position: relative;
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding: 10px 40px 10px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
    height: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 20%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 4px;
    user-select: none;
    color: var(--deepred);
    font-weight: 600;
    border-radius: 2px;
    white-space: nowrap;
    z-index: 1;
    line-height: 1;
    width: auto;
    max-width: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: var(--deepred);
}

.admin-form .toggle-password {
    position: absolute;
    right: 10px;
    top: 20%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    user-select: none;
    color: var(--deepred);
    font-weight: 600;
    border-radius: 2px;
    white-space: nowrap;
    z-index: 1;
    line-height: 1;
    width: auto;
    max-width: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.admin-form .toggle-password:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Ensure cards and common UI containers are slightly lighter in dark mode for better contrast. */
body.darkmode .card,
body.darkmode .login_form,

body.darkmode .booking-controls,
body.darkmode .availability-grid,
body.darkmode .verification-container,
body.darkmode .verification-instructions,
body.darkmode .registration-message,
body.darkmode .login-message,
body.darkmode .forgot-password-message,
body.darkmode .reset-password-message
 {
    background:  #802f2f !important;
    box-shadow: var(--deepred) 0px 3px 8px !important;
    border-radius: 8px !important;
}

body.darkmode #profile_box{
    background:  #111111 !important;
    box-shadow: var(--deepred) 0px 3px 8px !important;
    border-radius: 8px !important;
}
body.darkmode #contact_info{
 background:  #802f2f !important;
    box-shadow: var(--deepred) 0px 3px 8px !important;
    border-radius: 8px !important;
    
}
/* Dark-mode label color inside the contact info box */
body.darkmode #contact_info label,
body.darkmode #contact_info .contact_label,
body.darkmode #contact_info .contact_list li {
    color: var(--white) !important;
}

body.darkmode #my-bookings-box{
    background:  #111111 !important;
    box-shadow: var(--deepred) 0px 3px 8px !important;
    border-radius: 8px !important;
    color: var(--white) !important;
}

/* Make the inner content appear as a red panel inside the dark outer frame.
   We target direct children so dynamically injected HTML (via innerHTML)
   gets the red panel look without changing the markup. */
body.darkmode #my-bookings-box {
    padding: 18px !important;
}

body.darkmode #my-bookings-box > * {
    background: var(--red) !important;
    color: var(--white) !important;
    padding: 18px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

/* Force headings, labels and other inline-styled text to white in dark mode */
body.darkmode #my-bookings-box h3,
body.darkmode #my-bookings-box h4,
body.darkmode #my-bookings-box p,
body.darkmode #my-bookings-box strong,
body.darkmode #my-bookings-box label,
body.darkmode #my-bookings-box .cancel-booking-btn,
body.darkmode #my-bookings-box span {
    color: var(--white) !important;
}

/* Ensure buttons remain readable */
body.darkmode #my-bookings-box .cancel-booking-btn {
    background-color: #b23b3b !important;
    color: var(--white) !important;
}

/* Dark mode: make form controls in makeBooking readable */
body.darkmode #dateSelect,
body.darkmode #categorySelect,
body.darkmode .booking-controls .control-group select,
body.darkmode .booking-controls .control-group input[type="date"] {
    color: var(--white) !important;
    background: var(--red) !important;
    border-color: rgba(255,255,255,0.12) !important;
}

/* Make select and date inputs share the red inner panel look */
body.darkmode #dateSelect,
body.darkmode #categorySelect,
body.darkmode .booking-controls .control-group select {
    color: var(--white) !important;
    background: var(--red) !important;
    border-color: rgba(255,255,255,0.12) !important;
}

/* Improve placeholder text / caret visibility for inputs in dark mode */
body.darkmode #dateSelect::placeholder,
body.darkmode .booking-controls input::placeholder {
    color: rgba(255,255,255,0.7) !important;
}

/* Legend (Available / Booked / Maintenance) card uses same red panel in dark mode */
body.darkmode .legend {
    background: var(--red) !important;
    color: var(--white) !important;
    box-shadow: var(--deepred) 0px 3px 8px !important;
    border-radius: 8px !important;
}

body.darkmode .legend .legend-item,
body.darkmode .legend span,
body.darkmode .legend .legend-color {
    color: var(--white) !important;
}

/* Make the small legend color boxes stand out against the red background */
body.darkmode .legend .legend-color {
    border: 1px solid rgba(255,255,255,0.12) !important;
}

/* Make the form labels white in dark mode (Select Date / Resource Category) */
body.darkmode .booking-controls .control-group label,
body.darkmode .booking-controls label {
    color: var(--white) !important;
}

/* Try to style select dropdown options — note: browser support varies for native select dropdown styling */
body.darkmode select option,
body.darkmode #categorySelect option {
    background: var(--red) !important;
    color: var(--white) !important;
}

/* Date input - make the picker indicator more visible on red (WebKit browsers) */
body.darkmode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2) !important;
}

/* For Firefox, try to style the dropdown and calendar via appearance reset (limited) */
body.darkmode select,
body.darkmode input[type="date"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Booking modal: match the red inner panel look in dark mode */
body.darkmode .booking-modal {
    background-color: rgba(0,0,0,0.6) !important;
}

body.darkmode .booking-modal .modal-content {
    background: var(--red) !important;
    color: var(--white) !important;
    box-shadow: var(--deepred) 0px 5px 15px !important;
    border-radius: 8px !important;
    padding: 24px !important;
}

body.darkmode .booking-modal .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

body.darkmode .booking-modal .modal-header h3 {
    color: var(--white) !important;
}

body.darkmode .booking-modal .form-group label {
    color: var(--white) !important;
}

body.darkmode .booking-modal .form-group input,
body.darkmode .booking-modal .form-group textarea {
    background: rgba(0,0,0,0.12) !important;
    color: var(--white) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

body.darkmode .booking-modal .modal-buttons .btn-primary {
    background-color: #b23b3b !important;
    color: var(--white) !important;
}

body.darkmode .booking-modal .modal-buttons .btn-secondary {
    background-color: rgba(255,255,255,0.08) !important;
    color: var(--white) !important;
}




/*Error message styling*/
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

/*Registration message styling*/
.registration-message {
    padding: 15px;
    margin: 20px auto;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    max-width: 400px;
}

.registration-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.registration-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.registration-message.error a {
    color: var(--red);
    text-decoration: underline;
    font-weight: 600;
}

.registration-message.error a:hover {
    color: var(--deepred);
    text-decoration: none;
}

/*Email verification instructions styling*/
.verification-instructions {
    box-shadow: var(--deepred) 0px 5px 15px;
    border-radius: 10px;
    padding: 30px 50px;
    text-align: center;
    width: 400px;
    margin: 30px auto;
    background-color: #f8f9fa;
    border: 2px solid var(--blue);
}

.verification-instructions h3 {
    color: var(--deepred);
    margin-bottom: 20px;
    font-size: 24px;
}

.verification-instructions p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #333;
}

.verification-instructions strong {
    color: var(--red);
    font-weight: 600;
}

.verification-instructions small {
    font-size: 12px;
    color: #666;
}

.verification-instructions a {
    color: var(--red);
    text-decoration: underline;
}

.verification-instructions a:hover {
    color: var(--deepred);
    text-decoration: none;
}

/*Email verification page styling*/
.verification-container {
    box-shadow: var(--deepred) 0px 5px 15px;
    border-radius: 10px;
    padding: 40px 50px;
    text-align: center;
    max-width: 500px;
    margin: 50px auto;
}

.verification-container h2 {
    color: var(--deepred);
    margin-bottom: 30px;
    font-size: 28px;
}

.verification-result {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    line-height: 1.6;
}

.verification-result.loading {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
}

.verification-result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.verification-result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.login-link, .register-link {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid var(--red);
    border-radius: 5px;
    display: inline-block;
    margin: 5px;
    transition: all 0.3s ease;
}

.login-link:hover, .register-link:hover {
    background-color: var(--red);
    color: var(--white);
    text-decoration: none;
}

/*Login message styling*/
.login-message {
    padding: 15px;
    margin: 20px auto;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    max-width: 400px;
}

.login-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.login-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/*Forgot password message styling*/
.forgot-password-message {
    padding: 15px;
    margin: 20px auto;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    max-width: 400px;
}

.forgot-password-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.forgot-password-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/*Reset password message styling*/
.reset-password-message {
    padding: 15px;
    margin: 20px auto;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    max-width: 400px;
}

.reset-password-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.reset-password-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/*profile styling*/

#profile_box {
    box-shadow: var(--deepred) 0px 5px 15px;
    border-radius: 10px;

    padding: 20px;
}

#profile_box img {
    border-radius: 20px;
    box-shadow: var(--deepred) 0px 5px 15px;
}

#avatar {
    display: flex;
    gap: 20px;

    padding-bottom: 20px;

    font-size: 20px;
}

#profile_box #contact_info {
    list-style-type: none;

    display: inline-block;
    padding: 0px 10px 10px 10px;

    border-radius: 20px;
    box-shadow: var(--deepred) 0px 5px 15px;


}

#profile_box li {
    margin: 20px;
    display: flex;
    flex-direction: column;
    width: 200px;
}



