:root {
    --bg1: rgb(240, 238, 229);
    --bg2: rgb(245, 244, 239);
    --primary-color: rgb(83, 81, 70);
    --secondary-color: #2ecc71;
    --background-color: #f5f6fa;
    --text-color: rgb(83, 81, 70);
    --input-bg-color: rgb(248, 248, 247);
    --button-text-color: rgba(41, 38, 27, 0.9);
    --button-text-hover-color: rgb(15, 15, 13);
    --button-hover-color: rgba(201, 192, 161, 0.6);
    --button-bg: rgba(201, 192, 161, 0.6);
    --button-bg-1: rgba(201, 192, 161, 0.1);
    --button-bg-2: rgba(201, 192, 161, 0.3);
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --border-color: rgba(112, 107, 87, 0.5);
    --console-bg: rgb(40, 44, 52);
    --code-block-background: rgb(232, 229, 216);
    --code-block-color: rgb(83, 81, 70);
    --item-tree-bg: white;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg1: rgb(43, 42, 39);
        --bg2: rgb(47, 47, 44);
        --primary-color: rgb(33, 32, 28);
        --secondary-color: #2ecc71;
        --background-color: #f5f6fa;
        --text-color: rgb(245, 244, 239);
        --input-bg-color: rgb(57, 57, 55);
        --button-bg: rgba(15, 15, 13, 0.58);
        --button-bg-1: rgba(15, 15, 13, 0.1);
        --button-bg-2: rgba(15, 15, 13, 0.3);
        --button-text-color: rgba(245, 244, 239, 0.9);
        --button-text-hover-color: rgb(245, 244, 239);
        --button-hover-color: rgba(15, 15, 13, 0.6);
        --error-color: #e74c3c;
        --success-color: #27ae60;
        --border-color: rgba(112, 107, 87, 0.5);
        --console-bg: rgb(40, 44, 52);
        --code-block-background: rgb(33, 32, 28);
        --code-block-color: rgba(245, 244, 239, 0.6);
        --item-tree-bg: rgba(57, 57, 55, 0.75);
    }
}

body {
    font-family: __tiempos_b6f14e, __tiempos_Fallback_b6f14e, ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    background-color: var(--background-color);
    background-image: linear-gradient(var(--bg1), var(--bg2));
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.login-container {
    background-color: var(--input-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    margin: 10% auto;
}

h1 {
    margin-bottom: 1.5rem;
    font-size: 18px;
    font-weight: 500;
}

input[type="email"],
input[type="text"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 9.6px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box;
    box-shadow: rgba(0, 0, 0, 0) 0 0 0 0, rgba(0, 0, 0, 0) 0 0 0 0, rgba(0, 0, 0, 0.1) 0 1px 3px 0, rgba(0, 0, 0, 0.1) 0 1px 2px -1px;
}

input::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}

button {
    width: 100%;
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--button-bg);
    background-image: radial-gradient(var(--button-bg-1) 50%, var(--button-bg-2));
    color: var(--button-text-color);
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 0.5px solid var(--border-color);
}

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

#message {
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
}

.error {
    color: var(--error-color);
}

.success {
    color: var(--success-color);
}

#totp-form {
    display: none;
}

/* Styles pour la page principale */
.header {
    padding: 1.2rem 1rem 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

#item-tree {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--item-tree-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.tree-item {
    margin-bottom: 0.25rem;
    padding: 0.25rem;
}

.tree-item ul {
    margin-left: 0.2rem;
    padding-left: 13px;
    margin-top: 8px;
}

.folder {
    font-weight: bold;
    color: var(--text-color);
}

.file {
    color: var(--text-color);
}

.remove-btn, .ignore-toggle {
    font-size: 1.2em;
    margin-left: 5px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.remove-btn:hover {
    color: var(--button-hover-color);
}

.expander {
    cursor: pointer;
    user-select: none;
    margin-right: 3px;
    transition: transform 0.2s ease;
}

.expander.expanded {
    transform: rotate(90deg);
}

#console-wrapper {
    background-color: var(--console-bg);
    color: white;
    font-size: 0.8rem;
    height: 150px;
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    border-radius: 4px;
    overflow: hidden;
}

#console-header {
    padding: 0.25rem 0.5rem;
    background-color: var(--code-block-background);
    color: var(--code-block-color);
    font-weight: bold;
}

#console {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

.console-entry {
    margin-bottom: 0.25rem;
}

.console-entry.add { color: var(--success-color); }
.console-entry.change { color: #f39c12; }
.console-entry.delete { color: var(--error-color); }
.console-entry.info { color: var(--text-color); }
.console-entry.success { color: var(--success-color); }
.console-entry.synced { color: var(--success-color); }

@media (max-width: 600px) {
    .login-container {
        width: 90%;
        padding: 1rem;
    }

    .container {
        padding: 0.5rem;
    }
}

#no-projects {
    text-align: center;
    margin-top: 20px;
}

#logout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#logout-button:hover {
    background-color: #c0392b;
}

.sync-status {
    margin-left: 5px;
    font-size: 0.8em;
}

.sync-status.queued {
    color: #f39c12;
}

.sync-status.syncing {
    color: #3498db;
    animation: spin 1s linear infinite;
}

.sync-status.synced {
    color: #2ecc71;
}

.sync-status.error {
    color: #e74c3c;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

#status-line {
    margin: 10px 0;
    padding: 5px;
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.tree-item.ignored, .file.ignored, .folder.ignored {
    color: #999;
    opacity: 0.6;
}

.root-delete-btn {
    margin-right: 5px;
    cursor: pointer;
    color: #e74c3c;
    transition: opacity 0.2s ease;
}

.root-delete-btn:hover {
    opacity: 0.8;
}