/* =========================================
   Settings page layout
   ========================================= */

.settings-page-section {
    margin: 0;
    width: 100%;
}

.settings-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.08);
    padding: 20px 24px 28px;
}

.settings-header .upload-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Each section as a neat block */
.settings-section {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.settings-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.settings-section h4 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

/* Tip text / helper text shared with categories & storage */
.category-help-text,
.help-content {
    font-size: 14px;
    color: #4a5568;
}

/* =========================================
   Buttons
   ========================================= */

.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.settings-btn--primary {
    background: #667eea;
    color: #ffffff;
    border-color: #5a67d8;
    font-weight: 600;
}

.settings-btn--primary:hover {
    background: #5a67d8;
    border-color: #4c51bf;
    box-shadow: 0 2px 6px rgba(76, 81, 191, 0.35);
}

.settings-btn--neutral {
    background: #e2e8f0;
    color: #4a5568;
    border-color: #cbd5e0;
}

.settings-btn--neutral:hover {
    background: #cbd5e0;
    border-color: #a0aec0;
}

/* For rows of buttons inside sections */
.settings-section > div[style*="flex"] {
    gap: 10px !important;
}

/* =========================================
   Bookmark URL display
   ========================================= */

.bookmark-display {
    background: #f7fafc;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    color: #2d3748;
    word-break: break-all;
    margin-bottom: 10px;
}

/* =========================================
   Flash messages (for storage save)
   ========================================= */

.settings-flash {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.settings-flash-success {
    background: #e6fffa;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.settings-flash-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* =========================================
   Storage Locations table (modal content)
   NO GRID – pure table layout
   ========================================= */

.settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.settings-table th,
.settings-table td {
    padding: 6px 8px;
    font-size: 14px;
}

.settings-table th {
    text-align: left;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 12px;
}

.storage-locations-table tr:nth-child(even) {
    background: #f9fafb;
}

.storage-locations-table tr:hover {
    background: #edf2f7;
}

/* Inputs / selects inside the settings table:
   same height, consistent styling */
.settings-table .settings-input,
.settings-table .settings-select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    font-size: 14px;
    height: 36px;
    background: #ffffff;
}

/* Emoji column – narrower and centered */
.storage-locations-table td:nth-child(3) .settings-input {
    max-width: 3.5rem;
    text-align: center;
    margin: 0 auto;
}

/* Default Days and Sort columns – narrower and centered */
.storage-locations-table td:nth-child(4) .settings-input,
.storage-locations-table td:nth-child(5) .settings-input {
    max-width: 5rem;
    margin: 0 auto;
    text-align: right;
}

/* Delete checkbox column – centered & aligned */
.storage-locations-table td:last-child {
    text-align: center;
    vertical-align: middle;
}

.storage-locations-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Bottom actions row in the modal */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* =========================================
   Storage Locations modal shell
   (re-uses category modal styles where possible)
   ========================================= */

/* If your JS wraps the content in #storageLocationsModal and uses
   the same .category-management-modal overlay as categories, this
   will narrow it a bit and keep it tidy. Adjust selectors if needed. */

#storageLocationsModal .category-management-content,
#storageLocationsModal .storage-locations-modal-content {
    max-width: 720px;
    width: 100%;
}

/* Slightly tighten spacing inside the modal body that holds the table */
#storageLocationsModal .category-management-body {
    padding-top: 8px;
}

/* Make the help text above the table sit closer */
#storageLocationsModal .category-help-text {
    margin-bottom: 6px;
}
