/* General Body & Font Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* Main container */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Auth container for login/signup */
.auth-container {
    max-width: 400px;
    text-align: center;
}
.auth-container h1 {
    margin-bottom: 30px;
}
.auth-container form {
    display: flex;
    flex-direction: column;
}
.auth-container input {
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}
.auth-container button {
    padding: 8px 16px;
    background-color: #9398c8;
    color: #1029ac;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
}
.auth-container p {
    margin-top: 20px;
}

/* Header Styles */
h1, h2, h3 {
    color: #5a0707;
    text-align: center;
    font-family: 'Algerian', serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 1px;
}
h1 {
    font-size: 2.5em;
    font-weight: lighter;
    margin-bottom: 5px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #5a0707, #7e1414);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
h2 {
    font-size: 1.1em;
    color: #7e1414;
    font-weight: lighter;
    margin-top: 0;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
h3 {
    font-size: 1.1em;
    font-weight: lighter;
    border-bottom: 3px solid #5a0707;
    padding-bottom: 12px;
    margin-top: 0;
    text-align: left;
    color: #7e1414;
}

/* Project List */
.project-list {
    list-style: none;
    padding: 0;
}

.project-list li a {
    display: flex;
    align-items: center;       /* Vertical center */
    justify-content: center;   /* Horizontal center */
    min-height: 50px;          /* Optional: Ensures enough height for vertical centering to be noticeable; adjust as needed */
    padding: 15px 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 1.1em;
    transition: background-color 0.3s, transform 0.3s;
    box-sizing: border-box;    /* Ensures padding doesn't add to the width/height unexpectedly */
}

.project-list li a:hover {
    background-color: #e9e9f3;
    transform: translateY(-2px);
}


/* Activity List */
.activity-list { list-style-type: decimal-leading-zero; padding-left: 30px; }
.activity-list li {
    padding: 15px 10px; border-bottom: 1px solid #eee;
    position: relative; cursor: default;
    display: flex; justify-content: space-between; align-items: center;
}
.activity-list li .actions button {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}
.activity-list li .actions .delete-btn:hover { background: #ffebee; border-color: #b64444; }
.activity-list li .actions .edit-btn:hover { background: #e3f2fd; border-color: #114375; }

/* Tooltip on Hover */
.activity-list li:hover::after {
    content: attr(data-date); position: absolute;
    left: 102%; top: 50%; transform: translateY(-50%);
    background-color: #333; color: #fff; padding: 5px 10px;
    border-radius: 4px; font-size: 0.9em; white-space: nowrap; z-index: 10;
}
/* Edit controls styling */
.edit-controls {
    display: none; /* Hidden by default, shown for authenticated users */
}

.activity-date {
    color: #666;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Navigation Bar Styling */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: #1a237e;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.logout-btn {
    background-color: #1a237e;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9em;
    font-weight: bold;
}

.logout-btn:hover {
    background-color: #303f9f;
}

/* Make sure activity list items display dates properly */
.activity-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.activity-list li span {
    flex-grow: 1;
}

.activity-list li .actions {
    display: flex;
    gap: 8px;
}

.activity-list li button {
    background-color: #aeafcd;
    color: #112873;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: bold;
}

.activity-list li .delete-btn {
    background-color: #c62828;
    color: #8f1111;
}

/* Loading indicator styles */
.auth-loading {
    position: relative;
    overflow: hidden;
}

.auth-loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-loading::after {
    content: 'Loading...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a237e;
    font-size: 1.2em;
    font-weight: 600;
    z-index: 10000;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Hide forms when loading */
.auth-loading .auth-container form {
    opacity: 0.3;
    pointer-events: none;
}
/* Add Activity Form */
.add-activity-container { margin-top: 40px; }
.add-activity-container h3 { border-bottom: none; font-size: 1.3em; }
#add-activity-form { display: flex; gap: 10px; }
#add-activity-form input { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
#add-activity-form button {
    padding: 8px 16px; background-color: #1a237e; color: white;
    border: none; border-radius: 4px; cursor: pointer;
    font-size: 0.9em; font-weight: bold;
}

/* Links and Buttons */
.back-link { display: inline-block; margin-bottom: 20px; color: #1a237e; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Submit buttons styling */
.submit-btn, button[type="submit"] {
    padding: 8px 16px;
    background-color: #1a237e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.submit-btn:hover, button[type="submit"]:hover {
    background-color: #303f9f;
}

/* Move up/down buttons */
.move-up-btn, .move-down-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.move-up-btn:hover:not(:disabled), .move-down-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.move-up-btn:disabled, .move-down-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Delete buttons in lists */
.delete-parent-btn, .delete-sub-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 10px;
}

.delete-parent-btn:hover, .delete-sub-btn:hover {
    background-color: #ff5252;
}
