

:root {
    --paper-color: #f4e4bc;
    --secondary-color: #eedcac; /* d4c293*/
    --lighter-paper-color: #fef7d7;
    --darker-paper-color: #f7dca4;
    --darker-color: rgba(139, 115, 85, 0.12);
    --dark-brown: #423733;
}

html {
    width: 100%;
    /* height: 100%; */
}

body {
    width: 100%;
    /* height: 100%; */
    margin: 0;
    padding: 0;
    background: var(--paper-color);
    /* background: linear-gradient(135deg, #f4e4bc 0%, #e9a54c 100%); */
    font-family: 'Georgia', serif;
    overflow: auto;
    height: 100vh;
    cursor: text;
}


.hidden {
    display: none!important;
}

.thoughts-container {
    position: relative;
    width: 100vw;
    height: auto;
    /* display: flex;
    flex-direction: column; */
}

.thoughts-container__page {
    /* border-top: 1px solid var(--secondary-color); */
    box-sizing: border-box;
}

.thoughts-container__end {
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, var(--paper-color), var(--lighter-paper-color));
}

.thoughts-container__end.new-page-not-possible {
    background: linear-gradient(to bottom, var(--paper-color), var(--darker-paper-color));
}

.thought {
    position: absolute;
    /* background: rgba(139, 115, 85, 0.00); */ 
    border: none;
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: #2c1810;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    white-space: pre-wrap;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* Prevents iOS callout menu on tap-hold */
    outline: none !important;
    box-sizing: border-box;
}


/* These importants seem excessive */
.thought.dragging {
    cursor: grabbing !important;
    transform: scale(1.05) !important;
    z-index: 10 !important;
    background: rgba(139, 115, 85, 0.15) !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: none !important;
}

.thought:hover:not(.dragging) {
    background: rgba(139, 115, 85, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.thought[contenteditable="true"] {
    cursor: text;
    user-select: text;
}

.thought.editing {
    cursor: text;
    user-select: text;
    outline: none; /* Remove browser's default contentEditable outline */
}


/* thought.editing and current-thought should be the same thing, the current thought is the one that is being edited */

.thought.current-thought {
    background: rgba(139, 115, 85, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    outline: none !important; /* Remove outline from current thought */
}
.thought.targeted {
    border-left: 2px solid rgba(0, 0, 0, 0.225);
    /* border-right: 2px solid rgba(0, 0, 0, 0.225); */
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(1deg); }
    50% { transform: translateY(-6px) rotate(0deg); }
    75% { transform: translateY(-3px) rotate(-1deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.mouse-blob {
    position: fixed;
    width: 12px;
    height: 12px;
    background: rgba(44, 24, 16, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    animation: float 2s ease-in-out infinite;
}

/* Ink blot styles */
.ink-blot {
    position: fixed;
    border-radius: 60% 40% 50% 45%;
    cursor: pointer;
    /* transition: transform 0.3s ease; */
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
    transition: all 0.3s ease;
    background: radial-gradient(circle at 30% 30%, #2c1810, #1a0f0a);
}
.ink-blot__msg {
    position: absolute;
    top: 20%;
    left: 90%;
    width: max-content;
    padding: 5px 10px 5px 10px;
    white-space: normal;
    height: auto;
    max-width: 200px;
    transform: translate(0, -100%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    text-align:center;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    user-select: none;
    font-family: Georgia, 'Times New Roman', Times, serif;
    background: radial-gradient(circle at 30% 30%, #2c1810, #1a0f0a);
    border-radius: 18px 24px 22px 2px;
}

.no-transition {
    transition: none;
}

.ink-blot:active {
    transform: scale(0.95);
}

.ink-blot:not(.menu-expanded)::before {
    display: none;
}

.ink-blot:not(.menu-expanded)::after {
    display: none;
}

/* .ink-blot.menu-expanded::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

.ink-blot.menu-expanded::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 15px;
    width: 12px;
    height: 6px;
    background: #0f0907;
    border-radius: 50%;
    opacity: 0.6;
} */

.menu-item {
    border-radius: 50%;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #1a0f0a !important
}

.menu-item--delete:hover {
    background: rgba(243, 26, 48, 0.807);
    color: white !important;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.5); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.ink-blot:hover .menu-item {
    opacity: 1;
    transform: scale(1);
}

.generate-button {
    position: fixed;
    top: 20px;
    right: 80px;
    width: 40px;
    height: 40px;
    background: rgba(44, 24, 16, 0.1);
    border: 2px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(44, 24, 16, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.generate-button:hover {
    background: #4935dc;
    border-color: #3623c8;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.generate-button:active {
    transform: scale(0.95);
}


.save-button {
    position: fixed;
    top: 20px;
    right: 140px;
    width: 40px;
    height: 40px;
    background: rgba(44, 24, 16, 0.1);
    border: 2px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(44, 24, 16, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.save-button:hover {
    background: #4935dc;
    border-color: #3623c8;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.save-button:active {
    transform: scale(0.95);
}



/* Clear Button */
.clear-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(44, 24, 16, 0.1);
    border: 2px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(44, 24, 16, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.clear-button:hover {
    background: #dc3545;
    border-color: #c82333;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.clear-button:active {
    transform: scale(0.95);
}

.ink-trail {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(44, 24, 16, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    animation: fadeOut 2s ease-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

.thought-list-button {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(44, 24, 16, 0.1);
    border: 2px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(44, 24, 16, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.thought-list-button:hover {
    background: #a5811d42;
    border-color: #837c61;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(232, 140, 42, 0.3);
}

.thought-list-button:active {
    transform: scale(0.95);
}

/* Auth Button & Panel */
#auth-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11;
}

.auth-button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(44, 24, 16, 0.3);
    transition: all 0.3s ease;
}

.auth-button:hover {
    color: var(--dark-brown);
    transform: scale(1.1);
}

.auth-button.logged-in {
    color: rgba(175, 130, 76, 0.6);
}

.auth-button.logged-in:hover {
    color: rgba(175, 134, 76, 0.9);
}

.auth-panel {
    position: absolute;
    right: 0;
    top: 45px;
    width: 280px;
    padding: 15px;
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.auth-panel__header { margin-bottom: 15px; }
.auth-panel__tabs { display: flex; gap: 8px; }

.auth-tab {
    flex: 1;
    padding: 8px;
    background: #f4e7bca8;
    border: none;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: #2c1810;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover { background: #f4e7bcc9; }
.auth-tab.active {
    background: var(--darker-paper-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-weight: bold;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form__field { display: flex; flex-direction: column; gap: 4px; }
.auth-form__field label {
    font-size: 0.85rem;
    color: var(--dark-brown);
    font-weight: bold;
}

.auth-form__field input {
    padding: 8px 10px;
    background: #f4e7bca8;
    border: 2px solid rgba(44, 24, 16, 0.2);
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: #2c1810;
    transition: all 0.2s ease;
}

.auth-form__field input:focus {
    outline: none;
    border-color: rgba(44, 24, 16, 0.4);
    background: #fef7d7;
}

.auth-form__field input::placeholder { color: rgba(44, 24, 16, 0.3); }

.auth-form__submit {
    padding: 10px;
    background: var(--dark-brown);
    border: none;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-form__submit:hover {
    background: #2c1810;
    transform: translateY(-1px);
}

.auth-form__submit--secondary {
    background: rgba(44, 24, 16, 0.15);
    color: var(--dark-brown);
}

.auth-form__submit--secondary:hover { background: rgba(44, 24, 16, 0.25); }

.auth-form__message {
    font-size: 0.8rem;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
}

.auth-form__message.success {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.auth-form__message.error {
    background: rgba(244, 67, 54, 0.15);
    color: #c62828;
}

.auth-logged-in { display: flex; flex-direction: column; gap: 12px; }
.auth-user-info {
    padding: 12px;
    background: #f4e7bca8;
    border-radius: 8px;
    text-align: center;
}

.auth-user-email {
    font-size: 0.9rem;
    color: var(--dark-brown);
    font-weight: bold;
}

#thought-list-and-button {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 10;
}

.thought-list {
    position: relative;
    right: -5px;
    top: -5px;
    width: 300px;
    height: fit-content;
    min-height: 200px;
    max-height: 84vh;

    padding: 10px;
    padding-top: 55px;

    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
    border-radius: 15px;
    z-index: 9;
}

.thought-card {
    background: #f4e7bca8;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
}

.thought-card:hover {
    background: #f4e7bcc9;
    cursor: default;
}
.thought-card:active {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
}

.thought-card--inactive {
    /* opacity: 0.6; */
    background: #f4e7bc2b;
}

.thought-card--inactive:hover {
    /* opacity: 0.6; */
    background: #f4e7bc4c;
    cursor: default;
}

.thought-card--inactive .thought-card__text {
        color:#423733;
}

.thought-card__text {
    font-size: 1rem;
    color: #2c1810;
    margin-bottom: 6px;
    padding: 5px;
}

.thought-card__text--truncated::after {
    content: ' ...';
    color: #53210f8c;
}

.thought-card__timestamp {
    font-family: monospace;
    font-size: 0.66rem;
    color: #555;
    text-align: right;
}