/* Prevents horizontal scrolling */
html, body {
    width: 100%;
    overflow-x: hidden; /* Stops any content from overflowing */
    margin: 0;
    padding: 0;
}

/********************/
/* HEADER CSS
/********************/
.top-header {
    width: 100%;
    background-color: black;
    color: white;
    padding: 5px 15px; /* Ensure padding is even */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 40px; /* Adjust for better visibility */
    box-sizing: border-box;
}

.header-container {
    width: 100%; /* Make sure it spans the full width */
    display: flex;
    justify-content: flex-end; /* Push content to the right */
    padding-right: 15px; /* Add some padding so it's not flush with the edge */
}

.account-button {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 16px;
    margin-right: 0; /* Remove extra right margin */
}

.account-button i {
    margin-left: 5px;
    font-size: 20px;
}







/********************/
/* FOOTER CSS
/********************/

.nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 55px;
  box-shadow: 0 0  3px rgba(0, 0, 0, 0.2);
  background-color: #000;
  display: flex;
  overflow-x: auto;
}
.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  min-width: 50px;
  overflow: hidden;
  white-space: nowrap;
  font-family: sans-serif;
  font-size: 10px;
  color: #FFF;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease-in-out;
}
.nav__link:hover {
  background-color: #eeeeee;
}
.nav__link--active {
  color: #FFF;
}

/* MATERIAL-ICONS SETTINGS */
.material-icons.orange600 { color: #FB8C00; }
.material-icons.green { color: green; }
.material-icons.grey { color: #c0c0c0; }
.material-icons.lightred { color: #FFCCCB; }
.material-icons.darkred { color: #8B0000; }
.material-icons.blue { color: #2B65EC; }
.material-icons.white { color: #FFFFFF; }







/********************/
/* MAIN CONTENT CSS
/********************/
.main-content {
    position: relative; /* Changed from absolute */
    top: 40px; /* Reset top */
    width: 100%;
    min-height: calc(100vh - 95px); /* Ensures it takes up full height minus header/footer */
    overflow-y: auto; /* Allows scrolling if needed */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Prevents content from getting squished */
    box-sizing: border-box;
    padding: 10px;
}


/* Inner content to prevent excessive stretching */
.main-content-inner {
    width: 90%;
    max-width: 1200px; /* Prevents excessive stretching on wide screens */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers vertically */
    align-items: center; /* Centers horizontally */
}








/*************************/
/**** WEBSITE BUTTONS ***/
/***********************/

.button-3 {
    appearance: none;
    background-color: #2ea44f;
    border: 1px solid rgba(27, 31, 35, .15);
    border-radius: 6px;
    box-shadow: rgba(27, 31, 35, .1) 0 1px 0;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-family: -apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    padding: 6px 16px;
    position: relative;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    vertical-align: middle;
    white-space: nowrap;
}

.button-3:focus:not(:focus-visible):not(.focus-visible) {
    box-shadow: none;
    outline: none;
}

.button-3:hover {
    background-color: #2c974b;
}

.button-3:focus {
    box-shadow: rgba(46, 164, 79, .4) 0 0 0 3px;
    outline: none;
}

.button-3:disabled {
    background-color: #94d3a2;
    border-color: rgba(27, 31, 35, .1);
    color: rgba(255, 255, 255, .8);
    cursor: default;
}

.button-3:active {
    background-color: #298e46;
    box-shadow: rgba(20, 70, 32, .2) 0 1px 0 inset;
}


.button-4 {
    appearance: none;
    background-color: #FAFBFC;
    border: 1px solid rgba(27, 31, 35, 0.15);
    border-radius: 6px;
    box-shadow: rgba(27, 31, 35, 0.04) 0 1px 0, rgba(255, 255, 255, 0.25) 0 1px 0 inset;
    box-sizing: border-box;
    color: #24292E;
    cursor: pointer;
    display: inline-block;
    font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    list-style: none;
    padding: 6px 16px;
    position: relative;
    transition: background-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    vertical-align: middle;
    white-space: nowrap;
    word-wrap: break-word;
}

.button-4:hover {
    background-color: #F3F4F6;
    text-decoration: none;
    transition-duration: 0.1s;
}

.button-4:disabled {
    background-color: #FAFBFC;
    border-color: rgba(27, 31, 35, 0.15);
    color: #959DA5;
    cursor: default;
}

.button-4:active {
    background-color: #EDEFF2;
    box-shadow: rgba(225, 228, 232, 0.2) 0 1px 0 inset;
    transition: none 0s;
}

.button-4:focus {
    outline: 1px transparent;
}

.button-4:before {
    display: none;
}

.button-4:-webkit-details-marker {
    display: none;
}




/**************************/
/* NEW STORY CONTENT CSS */
/************************/
.story-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 80%;
    margin: auto;
}

.story-card {
    display: flex;
    align-items: center;
    background: #222;
    color: white;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none; /* Remove text decoration from the link */
    width: 100%;
    max-width: 700px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.story-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.2);
}

.story-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-right: 5px solid #444;
}

.story-details {
    padding: 15px;
    flex-grow: 1;
}

.story-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #f4c542;
    text-decoration: none; /* Remove underline */
}

.story-description {
    font-size: 14px;
    line-height: 1.4;
    color: #ddd;
    text-decoration: none; /* Remove underline */
}

/* Ensure all text inside the link has no text-decoration */
.story-card * {
    text-decoration: none;
    color: inherit; /* Keeps text color uniform */
}








/**************************/
/* CHARACTER CONTENT CSS */
/************************/
.characters {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    background-color: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.characters tr {
    border-bottom: 1px solid #ddd;
}

.characters td {
    padding: 15px;
    text-align: left;
    vertical-align: middle;
}

.td1 {
    width: 150px;
    text-align: center;
}

.td1 a {
    text-decoration: none; /* Remove link decorations */
    color: inherit; /* Keep text color consistent */
    display: block;
}

.characters-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.characters-img {
    width: 120px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #ccc;
    transition: transform 0.3s ease-in-out;
}

.characters-img:hover {
    transform: scale(1.05);
    border-color: #888;
}

.td2 {
    width: 100%;
    font-size: 14px;
    color: #555;
}

.character-info {
    margin: 5px 0;
    font-size: 16px;
}

.character-info strong {
    color: #222;
}








/***************************/
/* STORY READ CONTENT CSS */
/*************************/
/* Story Content Styling */
.story-read-container {
    top: -20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: auto;
    padding: 20px;
    font-family: "Georgia", serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.choices-container {
    display: flex;
    flex-wrap: wrap; /* Allows stacking if space is tight */
    justify-content: center; /* Center buttons */
    width: 100%;
    margin-top: 20px;
    padding-bottom: 40px;
}

.choice-button {
    flex: 1 1 45%; /* Makes buttons responsive */
    padding: 12px;
    margin: 5px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    color: white;
    background: #444;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.choice-button:hover {
    background: #222;
}

/* On smaller screens, make buttons full-width */
@media (max-width: 600px) {
    .choice-button {
        flex: 1 1 100%;
    }
}







/******************************/
/* STORY PAGE MANAGEMENT CSS */
/****************************/
.table-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
    overflow-x: auto; /* Allows horizontal scrolling if needed */
}

.styled-table {
    width: 100%;
    max-width: 1200px;
    border-collapse: collapse;
    background-color: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.styled-table thead {
    background-color: #222;
    color: white;
    text-transform: uppercase;
}

.styled-table th, 
.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    white-space: nowrap; /* Prevents text from breaking oddly */
}

.styled-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Buttons inside the table */
.styled-table td a {
    display: inline-block;
    margin: 4px;
}

/* Make table scrollable on small screens */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto; /* Allows horizontal scrolling */
    }
    .styled-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Stack table rows into "cards" on very small screens */
@media (max-width: 600px) {
    .styled-table,
    .styled-table thead,
    .styled-table tbody,
    .styled-table th,
    .styled-table td,
    .styled-table tr {
        display: block;
    }

    .styled-table thead {
        display: none; /* Hide table headers on mobile */
    }

    .styled-table tr {
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 10px;
        background-color: white;
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    }

    .styled-table td {
        border: none;
        padding: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .styled-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        color: #444;
    }

    /* Make action buttons full-width on mobile */
    .styled-table td a {
        width: 100%;
        text-align: center;
        display: block;
        margin: 5px 0;
    }
}







/******************************/
/* STORY EDIT MANAGEMENT CSS */
/****************************/
/* Responsive container for the form */
.responsive-form {
    display: flex;
    flex-direction: column;
    width: 90vw; /* Takes 90% of the viewport width */
    max-width: 1000px; /* Prevents it from getting too wide on desktops */
    margin: 0 auto; /* Centers the form */
    padding: 20px;
    box-sizing: border-box;
}

/* Title */
.page-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Form Box */
.form-box {
    width: 100%;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Form Inputs */
.form-box label {
    font-weight: bold;
    display: block;
    margin-top: 8px;
    font-size: 1rem;
}
.form-box input, .form-box textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Prevents text from overflowing */
textarea {
    width: 100%; /* Full width of the container */
    height: 300px; /* Larger default height */
    min-height: 150px; /* Prevents it from being too small */
    max-height: 600px; /* Optional: Prevents it from getting too large */
    resize: vertical; /* Allows resizing up/down */
    word-wrap: break-word; /* Prevents text overflow */
    font-size: 16px; /* Makes text more readable */
}

/* Submit Button */
.form-box input[type="submit"] {
    width: 100%;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border: none;
    padding: 12px;
    font-size: 1rem;
    margin-top: 10px;
}
.form-box input[type="submit"]:hover {
    background-color: #0056b3;
}

/* OR Divider */
.or-divider {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
    color: #555;
}

/* Back Link */
.back-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .responsive-form {
        width: 95vw; /* Takes 95% of the viewport width */
        padding: 10px;
        margin-left: -30px;
    }
    .form-box {
        padding: 10px;
    }
    .form-box input, .form-box textarea {
        font-size: 0.9rem;
        padding: 6px;
    }
    .form-box input[type="submit"] {
        padding: 10px;
        font-size: 0.9rem;
    }
    textarea {
        height: 250px; /* Slightly smaller on mobile */
        min-height: 120px;
    }
}







/* Login Form Styling */
.login-container {
    width: 100%;
    max-width: 400px; /* Limits form width on large screens */
    margin: 10vh auto; /* Centers form vertically */
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    text-align: center;
}

/* Mobile: No background, just a clean form */
@media screen and (max-width: 768px) {
    .login-container {
        width: 90%;
        max-width: 100%;
        box-shadow: none;
        border: none;
        margin-top: 20px;
    }
}

/* Labels */
.login-container label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    text-align: left;
}

/* Input Fields */
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Submit Button */
.login-container input[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.login-container input[type="submit"]:hover {
    background: #0056b3;
}

/* Remember Me & Forgot Password */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.remember-forgot a {
    text-decoration: none;
    color: #007bff;
}

.remember-forgot a:hover {
    text-decoration: underline;
}



.autosave-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 128, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}







/* EDIT CHOICES PAGE */
.page-title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Form Styling */
.edit-choice-form {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.edit-choice-form h3 {
    color: #444;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.edit-choice-form label {
    font-size: 1em;
    margin-bottom: 5px;
    display: block;
}

.edit-choice-form input[type="text"] {
    width: 100%;
    padding: 8px;
    font-size: 1em;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.edit-choice-form input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.edit-choice-form input[type="submit"]:hover {
    background-color: #45a049;
}

/* Button Styling */
.button-back, .button-submit {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 4px;
}

.button-back {
    margin-top: 10px;
    display: inline-block;
}

.button-submit {
    width: 100%;
}

/* Success/Failure Messages */
.success-message {
    color: green;
    font-weight: bold;
    margin-top: 20px;
}

.error-message {
    color: red;
    font-weight: bold;
    margin-top: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .edit-choice-form input[type="text"], .edit-choice-form input[type="submit"] {
        width: 100%;
    }

    .button-submit {
        width: auto;
    }
}
