/********************* Global Styles ************************/
body, html {
    margin: 0;
    height: 100%;
    padding: 0;
    display:flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.custom-btn {
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    text-transform: uppercase;
    font-weight: bold;
}

.custom-btn:hover {
    background-color: #0056b3; 
    color: #fff;
}

/************************ Shared Layout Styles **************************/

.story-list-container {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100%; 
    padding-top: 70px;
    padding-bottom: 20px;
    position: relative; 
    overflow: auto;
}

/* Ensure form elements are responsive */
.story-list-container form textarea {
    width: 100%; /* Make textarea take up full width of its container */
    max-width: 100%; /* Prevent it from exceeding container width */
    box-sizing: border-box; /* Include padding and border in the width */
    resize: vertical; /* Allow resizing only vertically */
    padding: 10px; /* Add some padding for better usability */
    font-size: 16px; /* Ensure readable font size */
}

/* Overlay for readability */
.story-list-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.169); /* Semi-transparent overlay */
    z-index: 1; /* Keep behind content */
}

/* Content block styling */
.story-list-container > * {
    position: relative;
    z-index: 2; /* Above the overlay */
    border-radius: 8px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.105); /* Subtle shadow */
    color: black; /* Text color for contrast */
    background-color: rgba(255, 255, 255, 0.566);
}

/************** Page-specific backgrounds ******************/

.story-list-container.explore-stories {
    background-image: url('/static/images/state1.jpg')
}

.story-list-container.my-collection {
    background-image: url('/static/images/sydney1.jpg'); 
}

.story-list-container.detail-page {
    background-image: url('/static/images/tower1.jpg');
}

.story-list-container.delete-page {
    background-image: url('/static/images/sphinx1.jpg');
}

.story-list-container.edit-page {
    background-image: url('/static/images/wall1.jpg');
}

.story-list-container.create-page {
    background-image: url('/static/images/parthenon1.jpg');
}

.story-list-container.contact-page {
    background-image: url('/static/images/japan1.jpg');
}


/****************** Django Messages ******************/

.message-container {
    position: fixed;
    top: 60px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050; /* Ensure messages appear above other elements */
    width: 90%; /* Make it responsive for smaller screens */
    max-width: 800px; /* Limit the width */
    padding: 10px; /* Add padding for breathing space */
}

.message-container .alert {
    margin-bottom: 10px; /* Space between multiple messages */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    background-color: whitesmoke;
}

/********************** Home/landing Page **********************/
.landing-page {
    position: relative;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(1,1fr);
    grid-template-rows: 1fr;
    gap: 0;
    background-color: #1e354d;
    overflow: hidden;
}

.landing-page div {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    width: 100%;
}

.landing-page div:nth-child(1) {
    background-image: url('/static/images/colosseum1.jpg');
}

.landing-page .content-overlay {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10; /* content sits above the grid */
    text-align: center; 
    color: white;
    text-shadow: 5px 5px 5px rgba(0, 0, 0, 0.995);
    padding: 20px;
    max-width: 800px;
    border-radius: 8px;
    grid-column: 1 / -1;
    grid-row: 1 /-1;
}

.content-overlay h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.content-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.content-overlay p {
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.content-overlay a {
    margin: 5px; /* Space between buttons */
    padding: 10px 20px;
}

/********** Text Styling for stories **********/

.story-list-container h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.story-list-container h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    color: black;
    border-bottom: 2px solid #ddd;
    padding: 5px;
}

.story-list-container ul {
    list-style: none;
    padding: 0;
}

.story-list-container li {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Light shadow */
}

/* Links for Edit/Delete */
.story-list-container a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-right: 10px;
}


/*************** Login/Signup/Logout Pages ***************/

.login-container {
    background-image: url('/static/images/stonehenge1.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh; /* Full viewport height */
    display: flex;
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    padding: 20px;
    position: relative; /* Required for overlay */
}

/* Add an overlay for readability */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    z-index: 1; /* Keep behind content */
}

.login-card {
    position: relative;
    z-index: 2; /* Above overlay */
    background-color: rgba(255, 255, 255, 0.564); /* Light background for readability */
    border: 1px solid #ddd; /* Subtle border */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    padding: 30px;
    width: 100%;
    max-width: 400px; /* Constrain width */
    text-align: center; /* Center-align text */
}

/* Primary button */
form .primaryAction {
    background-color: #333; /* Consistent with custom-btn */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

form .primaryAction:hover {
    background-color: #0056b3;
}

/* Secondary links */
form .secondaryAction {
    display: block;
    margin-top: 10px;
    color: #007bff; /* Link color */
    text-decoration: none;
}

form .secondaryAction:hover {
    text-decoration: underline; /* Underline on hover */
}

/********** footer **********/

footer {
    position: relative;
    width: 100%;
    z-index: 2;
    background-color: white;
    color: #333;
    text-align: center;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Optional shadow */
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-list {
    display: flex;
    list-style: none;
    gap: 20px;
}

.footer-list a {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem;
}

.footer-list a:hover {
    color: #0056b3;
}

/*************** Media queries ********************/

@media (min-width: 768px) {
    .landing-page {
        grid-template-columns: repeat(2, 1fr);
    }

    .landing-page div:nth-child(2) {
        background-image: url('/static/images/pyramids1.jpg');
    }
}

@media (min-width: 1024px) {
    .landing-page {
        grid-template-columns: repeat(3, 1fr);
    }

    .landing-page div:nth-child(3) {
        background-image: url('/static/images/parthenon1.jpg');
    }
}
/* laptops and desktops */
@media (min-width: 1440px) {
    .landing-page {
        grid-template-columns: repeat(6, 1fr);
    }

    .landing-page div:nth-child(4) {
        background-image: url('/static/images/stonehenge1.jpg');
    }

    .landing-page div:nth-child(5) {
        background-image: url('/static/images/northenlights1.jpg');
    }

    .landing-page div:nth-child(6) {
        background-image: url('/static/images/japan1.jpg');
    }
}