/* ==================== Body & Base ==================== */
body {
    font-family: 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f9f9f9, #e6ecf0);
    margin: 0;
    padding: 0;
    color: #333;
}

/* ==================== Title & Subtitle ==================== */
.title {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.3); /* Floating effect */
}

.subtitle {
    display: block;         /* makes it behave like a block */
    font-size: 1.2rem;
    font-weight: normal;
    color: #7f8c8d;
    margin: 0 auto 30px auto; /* top auto, bottom 30px, center horizontally */
    text-align: center;     /* center text */
    text-shadow: none;
}

/* ==================== Form Container ==================== */
form {
    background: #fff;
    max-width: 600px;
    margin: 0 auto 50px auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0px 6px 18px rgba(0,0,0,0.1);

    /* Form entrance animation */
    opacity: 0;
    transform: translateY(20px);
    animation: floatIn 0.8s ease-out forwards;
}

@keyframes floatIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect for form */
form:hover {
    transform: translateY(-5px);
    box-shadow: 0px 12px 24px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* ==================== Input Fields, Textarea, Select ==================== */
input[type="text"],
textarea,
select,
#keyword,
.search,
#weather,
.weather,
input[type="datetime-local"] {
    width: 100%;
    max-width: 600px;
    padding: 12px;
    margin: 10px auto 20px auto;
    display: block;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

/* Textarea specific */
textarea {
    min-height: 200px;
    resize: vertical;
}

/* Focus effect for inputs, textarea, selects */
input[type="text"]:focus,
textarea:focus,
select:focus,
#keyword:focus,
.search:focus,
input[type="datetime-local"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52,152,219,0.4);
    outline: none;
}

/* ==================== Buttons ==================== */
button,
input[type="submit"] {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

button:hover,
input[type="submit"]:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0px 6px 14px rgba(0,0,0,0.2);
}

/* ==================== Additional Styling ==================== */
h1 {
    text-align: center;
}

/* -------------------- Floating Labels for all fields -------------------- */
.form-group {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    appearance: none; /* remove default arrow on select */
}

/* Optional: add small padding-right for dropdown arrow */
.form-group select {
    padding-right: 30px;
}

/* Label styling */
.form-group label {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #7f8c8d;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: #fff;
    padding: 0 4px;
}

/* Floating effect when input/textarea/select has value or focus */
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label,
.form-group input[type="datetime-local"]:focus + label,
.form-group input[type="datetime-local"]:not(:placeholder-shown) + label {
    top: -10px;
    left: 8px;
    font-size: 0.85rem;
    color: #3498db;
}

/* Fade-in animation for new entries */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0; /* start hidden */
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Style for each journal entry */
/* Journal entry container */
#entries-container {
    margin: 20px;
}

.entry {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-left: 4px solid #4CAF50;  /* subtle colored line */
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.entry strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.entry em {
    display: block;
    margin-top: 8px;
    color: #555;
    font-style: italic;
}

.entry a {
    display: inline-block;
    margin-top: 8px;
    color: white;
    background-color: #4CAF50;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
}

.entry a:hover {
    background-color: #45a049;
}

/* Shared button style */
.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    color: #fff !important;   /* Force white text even on <a> */
    background-color: #007BFF;
    border: none;
    border-radius: 6px;
    text-decoration: none;    /* Remove underline from <a> */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Hover + click effects */
.btn:hover {
    background-color: #0056b3;
}

.btn:active {
    transform: scale(0.97);
}

/* Navigation bar */
nav {
    display: flex;
    justify-content: flex-end;   /* push entire nav to right */
    align-items: center;
    margin: 10px 20px 30px 0;
    white-space: nowrap;         /* keep links on one line */
}

nav a {
    display: inline-block;
    font-size: 0.85rem;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    /* base spacing is handled by the separator below */
}

nav a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Separator between links with padding so it doesn't crowd */
nav a:not(:last-child)::after {
    content: "|";
    color: #aaa;
    display: inline-block;
    padding: 0 8px;   /* space on both sides of the bar */
}

.entry-actions {
    margin-top: 8px;
}

.entry-actions a {
    margin-right: 10px;
    font-size: 0.85rem;
    color: #2c3e50;
    text-decoration: none;
}

.entry-actions a:hover {
    text-decoration: underline;
}

/* Delete button styling */
button.delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button.delete:hover {
    background: #c0392b;
}

/* Edit button styling (floating like Delete) */
a.edit-btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2); /* floating effect */
    margin-right: 6px; /* spacing before Delete button */
}

a.edit-btn:hover {
    background: #2980b9;
    transform: translateY(-2px); /* lift on hover */
}

/* Delete button (floating) */
button.delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2); /* floating effect */
}

button.delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Delete button (already added, here for context) */
button.delete {
    display: inline-block;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* floating effect */
}

button.delete:hover {
    background: #c0392b;
}

/* Ensure delete form stays inline without extra box */
.entry-actions form {
    display: inline;       /* form stays inline */
    margin: 0;             /* remove default margin */
    padding: 0;            /* remove white box padding */
    border: none;          /* no border around the form */
}

/* Action buttons row */
.entry-actions {
    display: flex;
    justify-content: space-between; /* pushes Delete to right */
    align-items: center;
    margin-top: 8px;
}

/* Ensure Delete button doesn’t stretch */
.entry-actions form {
    margin: 0;
}

.entry pre {
    white-space: pre-wrap;   /* preserves line breaks & wraps long lines */
    word-wrap: break-word;   /* ensures long words don’t break layout */
    font-family: inherit;    /* keeps your normal font */
    margin: 0;               /* removes extra spacing */
}

.entry-text {
    white-space: pre-line;   /* preserves newlines but collapses extra blank lines */
    margin: 5px 0;
    line-height: 1.4;        /* adjust for tighter spacing */
}