/* Reset and base styles */
body {
    --bg-image: url('white-pc.webp');
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* stack navbar above main content */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
}

.logEntry {
    background-color: white !important;
    padding: 16px 24px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.027);
    word-wrap: break-word;
    color: #333;
}

/* Background image */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--bg-image) center / cover no-repeat fixed;
    z-index: -1;
}

/* Navigation bar */
.navbar {
    background-color: #ff6f61;
    padding: 12px 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-sizing: border-box;
}

/* Nav list */
.nav-list {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

/* Nav list items */
.nav-list li {
    margin: 0;
}

/* Nav links */
.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Main content container below navbar */
.main-content {
    display: flex;
    flex: 1 1 auto;
    /* grow and fill available space */
    margin-top: 56px;
    /* height of navbar */
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
    padding: 32px;
    box-sizing: border-box;
    position: fixed;
    right: 0;
    top: 56px;
    /* below navbar */
    width: 200px;
    background: transparent;
    z-index: 10;
    overflow: auto;
}

/* Logs Section - fills remaining space */
.logs {
    flex: 1 1 auto;
    padding: 32px;
    margin: 20px 32px 20px 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow-y: auto;
    height: 100%;
}

/* Buttons */
.btn {
    background-color: #ff6f61;
    color: white;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#addBtn,
#moreLogsBtn {
    width: 100%;
    max-width: 180px;
    padding: 12px 32px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#addBtn:hover,
#moreLogsBtn:hover,
#addBtn:focus,
#moreLogsBtn:focus {
    background-color: #e65b4f;
    outline: none;
}

/* Scrollbar for logs */
.logs::-webkit-scrollbar {
    width: 10px;
}

.logs::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 10px;
}

.logs::-webkit-scrollbar-thumb {
    background-color: #5145cd;
    border-radius: 10px;
    border: 3px solid #f0f4f8;
}

/* Modal Overlay */
#overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 999;
}

/* Modal Container */
#modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
}

/* Modal Box */
.modal-content {
    background: #fffaf0;
    color: #333;
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(255, 111, 97, 0.35);
    position: relative;
    overflow-y: auto;
}

/* Close Button */
.close {
    position: absolute;
    top: 16px;
    right: 22px;
    font-size: 30px;
    font-weight: 700;
    color: #ff6f61;
    cursor: pointer;
    user-select: none;
}

/* Labels */
label {
    font-weight: 600;
    color: #5145cd;
    margin-bottom: 6px;
    display: block;
    font-size: 16px;
}

/* -------- Firebase Authentication UI -------- */

.auth-container {
    background-color: #fff;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(255, 111, 97, 0.35);
    /* aligns with modal shadow */
    max-width: 320px;
    margin: 16px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #5145cd;
    /* align text color with your label color */
}

.auth-container label {
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 6px;
    display: block;
}

.auth-container input[type="email"],
.auth-container input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #ddd;
    font-size: 16px;
    font-weight: 400;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: text;
    margin-bottom: 14px;
}

.auth-container input[type="email"]:focus,
.auth-container input[type="password"]:focus {
    border-color: #ff6f61;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 111, 97, 0.6);
}

.auth-container button {
    width: 100%;
    background-color: #ff6f61;
    color: white;
    font-weight: 700;
    padding: 12px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 10px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.auth-container button:hover,
.auth-container button:focus {
    background-color: #e65b4f;
    outline: none;
}

#userInfo {
    font-weight: 600;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
    color: #333;
}


/* Text & Number Inputs */
input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 12px;
    border: 2px solid #ddd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    user-select: text;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: #ff6f61;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 111, 97, 0.6);
}

/* Layout Part-Price Row */
.part-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    align-items: center;
}

.part-input,
.price-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid #ddd;
    border-radius: 12px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.part-input:focus,
.price-input:focus {
    border-color: #ff6f61;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 111, 97, 0.6);
}