/* ------------ Reset CSS ------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ------------ NAVIGATION BASE ------------ */
/* ------------ NAVIGATION BASE ------------ */
/* ------------ NAVIGATION BASE ------------ */
header {
    background-color: #2c415e;
    color: #fff;
    z-index: 1000;
    position: relative; /* 🎯 Ensures shadow renders above full-width sections like .hero */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4); /* 🎯 Stronger, cleaner drop shadow */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Match max-width of .content-container */
    max-width: 1400px;
    margin: 0 auto;
    /* Match horizontal padding of .content-container so edges align perfectly */
    padding: 12px 40px;
    width: 100%;
}

.logo {
    height: 60px; /* Hieman suhteutetumpi koko */
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.03);
}
.nav {
    display: flex;
    justify-content: flex-end;  /* Align content to right */
    align-items: center;
    flex-grow: 1;
}

.nav-links {
    display: flex;
    gap: 1.5rem; /* Lisätty väliä linkkien välille */
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: auto;
    align-items: center;
}


.nav-links li {
    position: relative;
}

.nav-links a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 10px 16px;
    display: block;
    font-size: 1rem; /* Modernimpi fonttikoko pikkukirjaimille */
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 8px; /* Pyöristetyt taustat hoverille */
    transition: all 0.2s ease-in-out;
}


.nav-links a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links li.dropdown > a::after,
.nav-links li.dropdown-sub > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;  /* arrow appears right after text */
    vertical-align: middle;
    border-top: 6px solid white;    /* down arrow */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    width: 0;
    height: 0;
}

.nav-links li.dropdown-sub > a::after {
    border-top: none;
    border-left: 6px solid white;  /* right arrow */
    border-bottom: 6px solid transparent;
    border-top: 6px solid transparent;
    margin-left: 8px;
}



/* ------------ DROPDOWNS ------------ */
.dropdown-menu,
.dropdown-submenu {
    list-style: none; /* ✅ This removes the dots */
    display: none;
    position: absolute;
    background-color: #2c415e;
    top: 100%;
    left: 0;
    min-width: 200px;
    z-index: 999;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    padding: 0;
    margin: 0;
}


.dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown-sub:hover > .dropdown-submenu {
    display: block;
    left: 100%;
    top: 0;
}

.dropdown-menu li,
.dropdown-submenu li {
    border-bottom: 1px solid #444;
}

.dropdown-menu li:last-child,
.dropdown-submenu li:last-child {
    border-bottom: none;
}

/* Adjust sub-submenu link padding */
.dropdown-menu a,
.dropdown-submenu a {
    padding: 10px 15px;
    white-space: nowrap;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    color: white;
    opacity: 1;
    transition: opacity 1s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-width: 100%; /* allow alert to fill container */
    font-family: Arial, sans-serif;
}


.alert-success {
    background-color: #4CAF50;
}

.alert-error {
    background-color: #f44336;
}


/* ------------ PROFILE ICONS ------------ */
.iconList {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}


.profile-icon-image,
.logout-icon-image {
    height: 40px;
    border-radius: 50%;
}

/* ------------ HAMBURGER (optional for mobile) ------------ */
.hamburger-menu {
    display: none;
    height: 40px;
    cursor: pointer;
}


/* ------------------------------ MAIN & BODY ------------------------------ */
body {
    font-family: Calibri, sans-serif;
    background-image: url('../IMG/background.png');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    line-height: 1.6;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Tavallinen main (käytetään muilla sivuilla, kuten reksiterit) */
main {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

/* Etusivun main (poistaa keskitetyn flex-laatikon, jotta Hero pääsee täyteen leveyteen) */
.home-main {
    display: block;
    width: 100%;
    padding: 0;
}

/* Tavallisten sivujen valkoinen laatikko (Rekisterit, Profiili jne.) */
.main-section {
    width: 100%;
    max-width: 1400px;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ------------ FULL-WIDTH HERO (Etusivu) ------------ */
.hero {
    width: 100%;
    min-height: 550px;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url('../IMG/background.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;

    /* 🌟 FADES THE BOTTOM TO 0% OPACITY 🌟 */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);

    background-size: cover;
    background-position: center;
    padding: 6rem 2rem;
    transition: background-image 2s ease-in-out;
}

.hero {
    background-size: cover;
    background-position: center;
    padding: 6rem 2rem;
    color: white;
    text-align: center;
    transition: background-image 2s ease-in-out;
}

.hero-content {
    max-width: 800px;
    background: transparent; /* Removes the dark box! */
    padding: 0;               /* Removes extra box padding */
    border-radius: 0;         /* Removes box corners */
    box-shadow: none;         /* Removes box shadow if any exists */
}

/* Enhanced readability for text over the image */
.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    /* Strong text shadow keeps text sharp over any image colors */
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8), 0 4px 30px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
}

.hero-content h3 {
    font-size: 1.65rem;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

/* ------------ LEIJUVA SISÄLTÖLAATIKKO HERO-OSAN ALLA ------------ */
.content-container {
    max-width: 1300px;
    margin: -40px auto 50px auto; /* Nosto: Leijuu 40px Heron päälle */
    position: relative;
    z-index: 10;
    border-radius: 16px;
    padding: 40px;
}

/* ------------ PROFIILIKUVAKKEET NAVI-PALKISSA ------------ */
.nav-character-avatar,
.profile-icon-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-character-avatar:hover,
.profile-icon-image:hover {
    transform: scale(1.08);
    border-color: #38bdf8;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
}

h2 {
    font-size: 1.6rem;
    text-align: center;
    padding-bottom: 30px;
}

h3 {
    font-size: 1.2rem;
    text-align: center;
    font-weight: normal;
    padding-bottom: 1rem;
}

h5 {
    font-size: 1.1rem;
    font-weight: normal;
    text-align: center;
}

p {
    font-size: 1rem;
}

a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

a:hover,
a:focus {
    color: #004999;
}

a:active {
    color: #003366;
}

a.external::after {
    content: ' ↗';
    font-size: 0.9em;
    margin-left: 2px;
}

a {
    position: relative;
}

a::after {
    content: '';
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    transition: width 0.3s;
}

/* Disabled / Unimplemented Navigation Links */
.disabled-link {
    color: #94a3b8 !important;       /* Elegant slate grey */
    pointer-events: none;            /* Disables ALL clicks, hover actions, and taps */
    cursor: not-allowed;             /* Visual cue that it's unclickable */
    opacity: 0.6;                    /* Slightly faded appearance */
    text-decoration: line-through;   /* Optional: adds a subtle strikethrough so players immediately see it's locked */
}

img {
    max-width: 100%;
    height: auto;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


.btn:hover {
    transform: translateY(-2px);
}


.btn:active {
    transform: translateY(0) scale(0.98);
}


.btn:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}


.btn-blue {
    background-color: #23496a;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(86, 130, 174, 0.15);
    border-color: #e2e8f0;
}

.btn-blue:hover {
    background-color: #436a93;
    box-shadow: 0 4px 12px rgba(86, 130, 174, 0.3);
}


.btn-white {
    background-color: #e1eaff;
    color: #2d3748;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-white:hover {
    background-color: #bcd0ff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #1a202c;
}

.btn-red {
    background-color: #cd5b5b;
    color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-red:hover {
    background-color: #9f4040;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-green {
    background-color: #357537;
    color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-green:hover {
    background-color: #224c24;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-gray {
    background-color: #535353;
    color: #cfcfcf;
    font-style: italic;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* --------------------------- TOOLTIP --------------------------------------- */

.tooltip-icon {
    display: inline-block;
    margin-left: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(0, 123, 255, 0.51);
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    position: relative;
    font-size: 14px;
}

.tooltip-icon:hover {
    background-color: #5682ae;
}

.tooltip-text {
    visibility: hidden;
    width: 400px;
    background-color: rgba(51, 51, 51, 0.85);
    color: #fff;
    text-align: left;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* above the icon */
    left: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 15px;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ------------------------------ MODAL ------------------------------------ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: white;
    border-radius: 8px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh; /* limit modal height */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background-color: #23496a; /* dark blue/gray */
    color: white;
    padding-top: 12px;
    padding-bottom: 5px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-weight: 600;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    margin: 10px 0 0;
    /* <-- Adds space inside the scrollable area */
    padding: 10px 12px 12px 1.5rem;
}

.modal-header h2 {
    margin: 0;
    padding-bottom: 10px;
}

.modal-subheader {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 1.5rem 1.5rem;
}

/* ------------------------------- INPUT FIELDS ----------------------------------- */

/* ----------- PICTURE UPLOAD ------------------- */
.image-upload-label-character {
    width: 250px;
    height: 250px;
    border-radius: 10%;
    background-color: #ddd;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#characterPreviewImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.image-upload-label-horse {
    width: 270px;
    height: 200px;
    border-radius: 10%;
    background-color: #ddd;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#horsePreviewImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.image-upload-wrapper {
    display: flex;
    justify-content: center;
    position: relative;
}

.image-placeholder {
    font-size: 3rem;
    color: #888;
}

/* ----------------------------- */

#estimated_age {
    margin-left: 10px;
    width: 100px;
}

.checkbox-group-wrapper {
    margin-bottom: 1.5em;
}

.checkbox-group-label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em 1em;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.checkbox-item input[type="checkbox"] {
    width: 30px;
    height: 30px;
    accent-color: #86b8e2; /* optional: make checkbox green */
    color: white;
}

input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #86b8e2;
    margin-left: 1.5rem;
}


.checkbox-item label {
    font-size: 16px; /* optional: increase label text size */
    cursor: pointer;
}

.huom {
    padding-bottom: 10px;
}


/* ------------  BUTTONS   -------------------- */

.top-side {
    text-align: center;
}

.edit-and-delete-buttons {
    display: flex;
    justify-content: end;
}

.edit-and-delete-buttons {
    gap: 8px
}

.circle-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.32);
}

.circle-button:hover {
    transform: scale(1.1);
}

.circle-button img.icon-img {
    width: 30px;
    height: 30px;
    max-width: 30px;
}

/* Background colors */
.btn-delete { background-color: #dd5b68; }
.btn-edit   { background-color: #2a9d8f; }
.btn-owner  { background-color: #f4a261; }
.btn-dead   { background-color: #555252; }
.btn-stallion   { background-color: #3194d1; }

/* Background colors */
.btn-delete:hover { background-color: #b64b55; }
.btn-edit:hover   { background-color: #228375; }
.btn-owner:hover  { background-color: #cc8b52; }
.btn-dead:hover   { background-color: #454343; }
.btn-stallion:hover   { background-color: #267eac; }

/* ------------  BUTTONS   -------------------- */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    position: relative;
}

label {
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.input-field {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out;
}

.input-field:focus {
    border-color: #007bff;
    outline: none;
}

.input-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-row .form-group,
.input-row .checkbox-wrapper {
    flex: 1;
}

.input-row .checkbox-wrapper {
    flex: 0 0 auto; /* prevent it from stretching */
    white-space: nowrap;
    margin-top: 23px;
    width: 120px;
}

.checkbox-wrapper input[type="checkbox"] {
    transform: scale(1.5); /* Increase size (1.5 = 150%) */
    margin-right: 0.5rem;   /* Add some space between checkbox and label */
}

textarea.input-field {
    width: 100%;
    min-height: 200px;
    resize: vertical;
    padding: 8px;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.autocomplete-results {
    position: absolute;
    top: 100%; /* right below the input */
    left: 0;
    z-index: 10;
    background: white;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item:hover {
    background-color: #f0f0f0;
}

.input-error {
    border: 2px solid red !important;
    background-color: #ffe6e6;
}

/* --------------------------------------------------------------------------- */

.logout-icon-image {
    height: 30px;
    cursor: pointer;
    margin-left: 10px;
}

.label {
    font-weight: bold;
    font-size: 14px;
    padding: 4px 10px;
    margin-bottom: 8px;
    display: inline-block;
    border-radius: 4px;
}

.label-tanaan {
    background-color: #ffdddd;
    color: #b30000;
}

.label-huomenna {
    background-color: #fff3cd;
    color: #ff8c00;
}

.label-tulossa {
    background-color: rgba(197, 223, 244, 0.26);
    color: rgb(86, 130, 174);
}

/* ------------ FOOTER ------------ */
footer {
    background-color: #23496a;
    color: #000000;
    text-align: center;
    padding: 20px;
    width: 100%;
    bottom: 0;
    margin-top: auto;
    box-sizing: border-box;
}



/* Container alignment */
.iconList {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: 20px;
}

/* Character Circle Avatar */
.nav-character-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-character-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-character-avatar:hover {
    transform: scale(1.1);
    border-color: #38bdf8; /* Highlight accent color on hover */
}

/* Optional tooltip showing character's name on hover */
.nav-character-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(11, 42, 64, 0.9);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.nav-character-item:hover::after {
    opacity: 1;
}