/* General styles */
body {
    background-color: #d9e4dd;
    color: #000000;
    font-family: 'Roboto', sans-serif;
    padding: 5px 15px;
    line-height: 1.2em;
    max-width: 800px;
    margin: 0 auto;
}

body#bkmrk {
    max-width: none;
}

/* Container styles */
.container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 0 20px;
}

#bookmarks {
    flex-grow: 1;
    width: 100%;
}

#tags {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 300px; /* Set this to the desired width */
    width: 300px; /* Maintain the width regardless of container size */
    margin-left: 20px;
    align-self: flex-start;
    order: 2; /* Ensure it stays in the desired order */
}

#tags h2 {
    text-align: left;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .container {
        display: block;
        padding: 10px;
    }
    #tags {
        display: block; /* Show tags */
        order: 1; /* Place below bookmarks */
        width: 100%; /* Full width on mobile */
        margin-left: 0;
    }
    .toggle-tags-link {
        display: block;
        background-color: #f0f0f0;
        color: #333;
        padding: 10px 20px;
        margin-bottom: 20px;
        cursor: pointer;
        width: 100%;
        border: 1px solid #ddd;
        text-align: center;
        text-decoration: none; /* Remove underline from link */
    }
    .collapse.show {
        display: block; /* Show when clicked */
    }
}

/* Bookmark and Tag Card Styles */
.bookmark-card, .tag-card, .bookmark {
    border: 1px solid #ddd;
    padding: 20px;
    margin: 10px 0;
    background-color: #f9f9f9;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.bookmark-card:hover, .tag-card:hover, .bookmark:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bookmark-title, .tag-title, .bookmark h2 {
    font-size: 18px;
    margin: 0 0 10px;
    text-align: left;
}

.bookmark-description, .tag-description, .bookmark p {
    font-size: 14px;
    color: #555;
    margin: 10px 0;
}

.bookmark .tags {
    font-style: italic;
    color: #666;
}

.bookmark h2 a, .tag-title a {
    color: #2F4F4F;
    text-decoration: underline;
    transition: color 0.3s;
}

.bookmark h2 a:hover, .tag-title a:hover, .bookmark h2 a:focus, .tag-title a:focus {
    color: #2F4F4F;
    text-decoration: none;
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align items to the start of the container */
}

.nav {
    align-self: flex-end; /* Align nav at the bottom of the container */
    display: flex; /* This ensures that the nav items are in a row */
}

.nav a, .nav span {
    margin-left: 20px; /* Adds spacing between nav items */
}

/* Additional styles */
button {
    float: right;
    margin: 10px 0;
}

h1 {
    font-size: 1.4em;
    text-align: center;
    margin-block-end: 0;
}

h2 {
    font-size: 1.1em;
    font-weight: 400;
    font-style: italic;
    margin-block-start: 0;
    margin-block-end: 0;
    text-align: center;
    line-height: 2em;
}

h3 {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.2em;
}

h4 {
    font-size: 1.1em;
}

p {
    font-size: 1em;
    line-height: 1.2em;
}

a {
    color: #2F4F4F;
    text-decoration: underline;
    transition: color 0.3s;
}

a:hover, a:focus {
    color: #afeeee;
    text-decoration: none;
}

textarea {
    width: 100%;
    height: 200px;
}

hr {
    border: 0;
    border-top: 1px dashed #dddddd;
    opacity: 50%
}

/* BEGIN TAG STYLES */
#tags-container {
    width: 300px; /* Adjust based on your preference */
    margin-left: 20px;
    padding: 10px;
}

#tags-container h2 {
    text-align: left;
    margin-top: 0;
}

#tags-list {
    list-style-type: none;
    padding: 0;
}

#tags-list li {
    margin-bottom: 10px;
}

#tags-list a {
    color: #2F4F4F; /* This color is from your existing 'a' styles */
    text-decoration: none;
    transition: color 0.3s;
}

#tags-list a:hover, #tags-list a:focus {
    color: #afeeee;
    text-decoration: underline;
}
/* END TAGS */

/* MODAL STYLES */
.alert-message {
    transition: opacity 1s, height 1s, margin 1s ease-out; /* Add height and margin to the transition */
    overflow: hidden; /* Ensure the contents are clipped as the height reduces */
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
/* END MODAL */