/* This file controls the design, color, and layout of our app. */

/* Basic setup for the whole page */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding-bottom: 100px;
}

/* Styling for the header bar at the top */
header {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    margin: 0;
    font-size: 24px;
    flex-grow: 1; 
    text-align: center;
    padding-left: 50px; 
}

.header-action-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-action-btn:hover {
    background-color: #0056b3;
}

/* Styling for the main area that holds our list cards */
main {
    padding: 20px;
}

/* A simple style for the "Loading..." message */
.loading-message {
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    padding: 40px;
}

/* This is the main styling for each of our list cards */
.pack-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.pack-card-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eef0f2; 
}

.pack-card-header h2 {
    margin: 0;
    font-size: 18px;
    word-break: break-word;
    color: #212529; 
}

/* UPDATED: Rules now apply to both .pack-card-header and the main header */
.pack-card-header.header-travel, header.header-travel { background-color: #e8f7fa; border-bottom: 1px solid #d0edf4; }
.pack-card-header.header-school, header.header-school { background-color: #eaf6ec; border-bottom: 1px solid #d3eecd; }
.pack-card-header.header-personal, header.header-personal { background-color: #fff8e6; border-bottom: 1px solid #ffefc2; }
.pack-card-header.header-coaching, header.header-coaching { background-color: #fff2e8; border-bottom: 1px solid #fee3d0; }
.pack-card-header.header-study, header.header-study { background-color: #f1eafa; border-bottom: 1px solid #e3d4f4; }
.pack-card-header.header-other, header.header-other { background-color: #f1f3f5; border-bottom: 1px solid #e6e8eb; }
.pack-card-header.header-general, header.header-general { background-color: #e7f5ff; border-bottom: 1px solid #d0ebff; }


.card-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 15px;
}

.edit-icon {
    cursor: pointer;
    color: #007bff; 
    font-size: 16px;
}

.delete-icon {
    cursor: pointer;
    color: #dc3545; 
    font-size: 16px;
}

.archive-icon {
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
}

.unarchive-icon {
    cursor: pointer;
    color: #28a745;
    font-size: 16px;
}

/* This styles the little category tags */
.pack-category-display {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    color: #343a40; 
    background-color: #e9ecef; 
    display: inline-block;
    margin-bottom: 10px;
}

/* Category Tag Colors */
.pack-category-display.travel { background-color: #d1ecf1; }
.pack-category-display.school { background-color: #d4edda; }
.pack-category-display.personal { background-color: #fff3cd; }
.pack-category-display.coaching { background-color: #ffe8d1; }
.pack-category-display.study { background-color: #e2d9f3; }
.pack-category-display.other { background-color: #e9ecef; }
.pack-category-display.general { background-color: #dbeeff; }


.pack-card-body {
    padding: 15px;
}

.pack-card-body p {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
}

/* Styling the progress bar */
.progress-container {
    background-color: #e9ecef;
    border-radius: 10px;
    height: 8px;
    margin-bottom: 5px;
}

.progress-bar {
    background-color: #007bff;
    height: 100%;
    border-radius: 10px;
}

.progress-text {
    font-size: 12px;
    text-align: right;
    margin-bottom: 0;
}

/* Styling for the big blue '+' button at the bottom */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style fix to make our card links look right */
a {
    text-decoration: none; 
    color: inherit;      
}
/* Styles for the detail page form and list */
.add-item-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.add-item-form input, .add-item-form select {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.add-item-form button {
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}
.item-list-container {
    list-style-type: none;
    padding: 0;
    border-radius: 8px;
    background-color: white;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.item-list-container li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f2f5;
}
.item-list-container li:last-child {
    border-bottom: none;
}
.item-content {
    display: flex;
    align-items: center;
    gap: 15px;
}
.item-details {
    display: flex;
    flex-direction: column;
}
.item-text.packed {
    text-decoration: line-through;
    color: #6c757d;
}
.item-note {
    font-size: 13px;
    color: #6c757d;
    margin-top: 2px;
}
.delete-item-icon {
    cursor: pointer;
    color: #dc3545;
    margin-left: 15px;
}
/* Styles for the Modal */
.modal {
    display: none; 
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.modal-content h2 {
    margin-top: 0;
}

#add-pack-form, #add-from-template-form, #share-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#add-pack-form input, #add-pack-form select, #add-from-template-form input, #add-from-template-form select, #share-form input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    background-color: white; 
}

#add-pack-form button, #add-from-template-form button, #share-form button {
    padding: 12px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
/* Styles for the Search Bar */
.search-container {
    padding: 20px 20px 10px 20px;
    background-color: white;
    border-bottom: 1px solid #eee;
}

#search-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box; 
}

/* Styles for Filter Buttons */
.filter-container {
    padding: 10px 20px;
    background-color: white;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; 
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}

.filter-btn:hover {
    background-color: #e2e6ea;
}

.filter-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Styles for Drag and Drop */
.drag-handle {
    cursor: grab;
    color: #ccc;
    margin-right: 15px;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #c8ebfb;
}

/* Styles for Modal Tabs */
.modal-options {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.modal-option-btn {
    flex-grow: 1;
    padding: 10px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; 
}

.modal-option-btn.active {
    border-bottom: 3px solid #007bff;
    font-weight: bold;
}

/* Styles for Header Button Group */
.header-buttons {
    display: flex;
    gap: 10px;
}

/* Styles for Login Prompt and User Profile */
.login-prompt-container {
    text-align: center;
    padding: 50px 20px;
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

#user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 300;
    width: 150px;
}

.dropdown-menu a, .dropdown-menu button {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.dropdown-menu a:hover, .dropdown-menu button:hover {
    background-color: #f0f2f5;
}

/* Styles for Share Modal */
#collaborators-list {
    margin-top: 20px;
}

#collaborators-list h3 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

#collaborators-list ul {
    list-style-type: none;
    padding: 0;
}

#collaborators-list li {
    padding: 8px 0;
    color: #333;
}
