@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Lora:wght@400;700&display=swap');

:root {
    /* --- Background Colors --- */
    --color-background: #f9f6f2;
    --color-header-bg: #DAD2C6;
    --color-tab-bg: #F5F0E9;
    --color-group-bg: #EDE6D6;

    /* --- Text Colors --- */
    --color-text-primary: #333333;
    --color-text-secondary: #4A3F35;
    --color-text-accent: #7A6A5E;
    --color-text-light: #f9f6f2;

    /* --- Button Colors --- */
    --color-button-primary: #6B4F4F;
    --color-button-primary-hover: #8C6E6E;
    --color-button-remove: #A0522D;
    --color-button-remove-hover: #8B4513;
    --color-button-restore: #2E8B57;
    --color-button-restore-hover: #3CB371;

    /* --- Move Here Button Colors --- */
    --color-moveHere-bg: #C1B7A4;
    --color-moveHere-hover-bg: #D1C4B7;

    /* --- Border Colors --- */
    --color-border-header: #BFAFA1;
    --color-border-tab: #E0DCCF;
    --color-border-search: #A89F91;

    /* --- Other Colors --- */
    --color-shadow: rgba(0, 0, 0, 0.1);
}

.darkTheme {
    /* --- Background Colors --- */
    --color-background: #1e1e1e;
    --color-header-bg: #2c2c2c;
    --color-tab-bg: #3a3a3a;
    --color-group-bg: #333333;

    /* --- Text Colors --- */
    --color-text-primary: #f9f6f2;
    --color-text-secondary: #d4d4d4;
    --color-text-accent: #e0e0e0;
    --color-text-light: #333333;

    /* --- Button Colors --- */
    --color-button-primary: #5A9BD4;
    --color-button-primary-hover: #7BB0E0;
    --color-button-remove: #d2691e;
    --color-button-remove-hover: #e57300;
    --color-button-restore: #66bb6a;
    --color-button-restore-hover: #81c784;

    /* --- Move Here Button Colors --- */
    --color-moveHere-bg: #4f4f4f;
    --color-moveHere-hover-bg: #5f5f5f;

    /* --- Border Colors --- */
    --color-border-header: #444444;
    --color-border-tab: #595959;
    --color-border-search: #777777;

    /* --- Other Colors --- */
    --color-shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Merriweather', serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
}

h2 {
    font-family: 'Lora', serif;
    color: var(--color-text-secondary);
}

button {
    background-color: var(--color-button-primary);
    padding: 8px 16px;
    color: var(--color-text-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0px 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

button:hover {
    background-color: var(--color-button-primary-hover);
}

input[type="checkbox"] {
    background-color: var(--color-background);
    cursor: pointer;
}

#resultMessage {
    text-align: center;
    margin-top: 20px;
    color: var(--color-text-accent);
}

#pageHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-header-bg);
    padding: 15px 40px;
    border-bottom: 1px solid var(--color-border-header);
    box-shadow: 0 2px 4px var(--color-shadow);
}

#headerLeft, #headerCenter, #headerRight {
    flex: 1;
    display: flex;
    align-items: center;
}

#headerCenter {
    justify-content: center;
}

#headerRight {
    justify-content: flex-end;
}

#homeLink {
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text-secondary);
}

#homeLink:hover {
    text-decoration: underline;
}

#searchInput {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    font-size: 16px;
    border: 2px solid var(--color-border-search);
    border-radius: 4px;
    background-color: var(--color-background);
    color: var(--color-text-primary);
}

#searchInput:focus {
    outline: none !important;
    border: 3px solid var(--color-button-primary);
    padding: 9px 13px;
}

#settingsButton {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: 10px;
}

#settingsButton:hover {
    opacity: 0.8;
}

#settingsButton .iconImage {
    width: 36px;
    height: 36px;
}

#mainContent {
    max-width: 1000px;
    margin: 90px auto 20px;
    padding: 20px;
}

#tabsContent, #settingsContent {
    width: 100%;
}

.tabList {
    display: grid;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.tabList li {
    display: grid !important;
    background-color: var(--color-tab-bg);
    border-bottom: 1px solid var(--color-border-tab);
}

.tabList li:last-child {
    border-bottom: none;
}

.tabList li .tabContainer {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

.tabList li .tabContainer a {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: 16px;
    flex-grow: 1;
}

.tabList li .tabContainer a:hover {
    text-decoration: underline;
}

.tabList li .moveHereButton, .tabGroup .moveHereButton {
    display: block;
    background-color: var(--color-moveHere-bg);
    color: var(--color-text-accent);
    padding: 0;
    margin: 0;
    border: 1px dashed var(--color-text-accent);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tabList li .moveHereButton:hover, .tabGroup .moveHereButton:hover {
    background-color: var(--color-moveHere-hover-bg);
}

.tabCheckbox {
    margin-right: 10px;
}

.tabGroup {
    display: grid !important;
    margin-bottom: 20px;
    border: 1px solid var(--color-border-tab);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--color-tab-bg);
}

.groupHeaderContainer, .groupFooterContainer {
    display: flex;
    align-items: center;
    background-color: var(--color-group-bg);
    padding: 10px 15px;
}

.groupHeaderContainer {
    cursor: pointer;
}

.groupHeaderContainer .masterCheckbox {
    margin-right: 10px;
}

.groupHeaderContainer .groupTitle, .groupFooterContainer .tabsCount {
    flex-grow: 1;
    margin: 0;
    padding: 0;
}

.groupHeaderContainer .groupTitle[contenteditable="true"] {
    outline: 2px solid var(--color-button-primary);
    background-color: var(--color-background);
    padding: 2px;
    border-radius: 4px;
}

.groupFooterContainer .tabsCount {
    display: flex;
    justify-content: flex-end;
    margin-right: 5px;
    color: var(--color-text-accent);
}

.groupHeaderContainer .removeGroupButton, .groupFooterContainer .removeSelectedButton, .removeTabButton {
    background-color: var(--color-button-remove);
}

.groupHeaderContainer .removeGroupButton:hover, .groupFooterContainer .removeSelectedButton:hover, .removeTabButton:hover {
    background-color: var(--color-button-remove-hover);
}

.groupHeaderContainer .restoreGroupButton, .groupFooterContainer .restoreSelectedButton {
    background-color: var(--color-button-restore);
}

.groupHeaderContainer .restoreGroupButton:hover, .groupFooterContainer .restoreSelectedButton:hover {
    background-color: var(--color-button-restore-hover);
}