/* Safari-themed stylesheet */

body {
    font-family: 'Arial', sans-serif;
    background-color: #FDF5E6; /* Papaya Whip - a light, sandy color */
    color: #5D4037; /* Dark brown - for text */
    margin: 0;
    padding: 0;
}

header {
    background-color: #8B4513; /* Saddle Brown */
    color: #FFFFFF;
    padding: 1rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Added for absolute positioning of menu-toggle if needed */
}

h1 {
    font-family: 'Georgia', serif;
    font-size: 1.8rem; /* Smaller font size for mobile */
    margin: 0;
    flex-grow: 1; /* Allows h1 to take available space */
    text-align: center; /* Center the text within h1 */
}

.menu-toggle {
    cursor: pointer;
    display: block;
    position: absolute; /* Position relative to header */
    right: 1rem; /* Adjust as needed */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000; /* Ensure it's above other content */
}

.hamburger {
    width: 30px;
    height: 3px;
    background-color: white;
    margin: 6px 0;
    transition: 0.4s;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}


/* Added from login.html */
.login {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 1rem auto;
}

.login input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.login button {
    padding: 0.75rem;
    width: 100%;
    background: #8B4513; /* Saddle Brown */
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.login .error {
    color: red;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #8B4513;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

main {
    padding: 1rem; /* Default padding for smaller screens */
}

.nav {
    list-style-type: none;
    padding: 0;
    text-align: center;
    margin-bottom: 1rem;
    display: none; /* Hidden by default on small screens */
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #8B4513; /* Same as header for continuity */
}

.nav.active {
    display: flex; /* Display when active */
}

.nav li {
    display: block;
    margin: 0.5rem 0;
}

.nav a {
    font-size: 1.2rem;
    font-weight: bold;
    color: white; /* Ensure links are visible on dark background */
    padding: 0.5rem 0;
    display: block;
}

/* Media Queries for Responsive Design */
@media (min-width: 600px) {
    header {
        justify-content: center; /* Center items in header on larger screens */
    }

    .nav {
        display: flex; /* Always visible on larger screens */
        flex-direction: row;
        position: static;
        background-color: transparent;
        /* margin-bottom: 2rem; */
        width: auto;
    }

    .nav li {
        display: inline;
        margin: 0 1rem;
    }

    .nav a {
        color: white; /* Default link color */
    }

    .menu-toggle {
        display: none; /* Hide hamburger on larger screens */
    }

    h1 {
        font-size: 3rem;
        flex-grow: 0; /* Reset flex-grow for h1 on larger screens */
    }

    main {
        padding: 2rem;
    }

    .login {
        padding: 2rem;
        margin: 2rem auto;
    }

    table {
        margin: 2rem 0;
    }
}

/* Photo Grid Styles */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-item {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.photo-item img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.photo-item p {
    font-size: 0.9rem;
    color: #5D4037;
    margin: 0;
}

.photo-item p a {
    text-decoration: none;
}

.photo-item p a:hover {
    text-decoration: none; /* Ensure no underline on hover either */
    opacity: 0.8; /* Optional: subtle hover effect */
}

.photo-item form {
    display: inline;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: none;
}

/* Form Styles for Upload Page */
.styled-form {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 500px; /* Adjusted max-width for better form layout */
    margin: 2rem auto;
}

.styled-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #5D4037; /* Dark brown for labels */
}

.styled-form input[type="text"],
.styled-form input[type="password"],
.styled-form input[type="email"],
.styled-form input[type="date"],
.styled-form input[type="file"],
.styled-form textarea,
.styled-form select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 1rem;
    line-height: 1.5; /* Improve text alignment */
    color: #5D4037; /* Dark brown for input text */
    background-color: #fff;
    background-clip: padding-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.styled-form input[type="text"]:focus,
.styled-form input[type="password"]:focus,
.styled-form input[type="email"]:focus,
.styled-form input[type="date"]:focus,
.styled-form input[type="file"]:focus,
.styled-form textarea:focus,
.styled-form select:focus {
    border-color: #2E8B57; /* Sea Green focus */
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(46, 139, 87, 0.25); /* Sea Green shadow */
}

.styled-form button {
    padding: 0.75rem;
    width: 100%;
    background: #8B4513; /* Saddle Brown - matching theme */
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease; /* Smooth transition for hover */
}

.styled-form button:hover {
    background: #A0522D; /* Sienna - slightly lighter brown on hover */
}

.location-picker {
    margin-bottom: 1rem;
}
.lat-long-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1rem;
    margin-bottom: 1rem;
}
.location-buttons {
    display: flex;
    gap: 1rem;
}
.location-buttons .button {
    width: auto;
}

/* Photo Detail for Comment Pages */
.photo-detail {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 2rem auto 1rem auto;
    text-align: center;
}

.photo-detail img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.photo-detail p {
    font-size: 1rem;
    color: #5D4037;
    margin: 0;
}

.photo-detail .button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2E8B57; /* Sea Green */
    color: white;
    text-decoration: none;
    border-radius: 0.25rem;
    margin-top: 1rem;
}

.photo-detail .button:hover {
    background: #3CB371; /* Medium Sea Green */
}

/* Comments List */
.comments-list {
    max-width: 600px;
    margin: 1rem auto;
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.comment-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-text {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: #777;
    text-align: right;
}

.admin-table .button:hover {
    opacity: 0.9;
}

.button.delete-button {
    background: none; /* No background for icon-like button */
    border: none;
    color: #D9534F; /* Red color for the icon */
    padding: 0; /* No padding */
    cursor: pointer;
    font-size: 1em; /* Match surrounding text size */
    margin-left: 0.5em;
    vertical-align: middle; /* Align with text */
    line-height: 1; /* Ensure consistent line height */
}

.button.delete-button:hover {
    color: #C9302C; /* Darker red on hover */
    background: none; /* Ensure no background on hover */
}

.comment-item form {
    display: inline;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: none;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: none;
}

.comment-meta {
    font-size: 0.8rem;
    color: #777;
    text-align: right;
}

        .pin > span {
          transform: rotate(0deg);
          color: white;
          font-weight: bold;
          font-family: sans-serif;
          font-size: 16px;
        }

/* Route Map Page Specific Styles */
body.route-map-page-body {
    overflow: hidden; /* Prevent body scroll when sidebar is open */
}

main.route-map-page {
    padding: 0; /* Remove padding for the route map page */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack elements vertically on mobile */
    height: calc(100vh - 4rem); /* Adjust height to fill viewport, assuming header is 4rem */
    position: relative; /* For positioning sidebar toggle */
}

#map {
    width: 100%; /* Full width on mobile */
    flex-grow: 1; /* Allow map to take available space */
    height: auto; /* Let flexbox manage height */
    z-index: 1; /* Ensure map is below sidebar */
}

#waypoint-list {
    width: 80%; /* Make sidebar slightly smaller than full width */
    max-width: 300px; /* Max width for sidebar */
    height: 100%; /* Full height when open */
    position: fixed; /* Overlay the map */
    top: 0;
    left: 0;
    background-color: #f5f5f5;
    overflow-y: auto;
    font-family: sans-serif;
    z-index: 1000; /* Ensure it's above the map */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
}

#waypoint-list.open {
    transform: translateX(0); /* Slide in when open */
}

.sidebar-toggle-btn {
    display: block; /* Show on mobile */
    position: fixed; /* Fixed position relative to viewport */
    top: 1rem;
    right: 1rem;
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 0.25rem;
    z-index: 1002; /* Above the sidebar */
}

.sidebar-toggle-btn.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    color: #5D4037;
    font-size: 2rem;
    padding: 0;
    z-index: 1001; /* Below the open button */
}

/* Adjust for larger screens */
@media (min-width: 768px) {
    main.route-map-page {
        flex-direction: row; /* Side-by-side on larger screens */
        height: 80vh; /* Revert to fixed height */
    }

    #map {
        width: 75%;
        height: 100%; /* Fill parent height */
    }

    #waypoint-list {
        width: 25%;
        height: 100%; /* Fill parent height */
        position: static; /* Back to static flow */
        transform: translateX(0); /* Always visible */
        padding: 20px;
        box-sizing: border-box;
        background-color: #f5f5f5;
        overflow-y: auto;
        z-index: auto;
    }

    .sidebar-toggle-btn {
        display: none; /* Hide on larger screens */
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-bottom: 1rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    position: absolute;
    left: 70px; /* Adjust as needed */
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #5D4037;
}

/* Admin Page Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.admin-table th {
    background-color: #8B4513;
    color: white;
}

.admin-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.admin-table .button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    background: #2E8B57;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
}

.admin-table .button.delete-button {
    background: #D9534F; /* Red for delete */
}

.admin-table .button:hover {
    opacity: 0.9;
}

.admin-form {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 2rem auto;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #5D4037;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.admin-form button[type="submit"] {
    padding: 0.75rem;
    width: 100%;
    background: #8B4513;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.admin-form button[type="submit"]:hover {
    background: #A0522D;
}

.error {
    color: red;
    margin-bottom: 1rem;
}
