/* MODIFIED: Added overflow hidden and removed margin to prevent document scrollbar */
body {
    background-color: rgb(243, 243, 243);
    color: black;
    overflow: hidden;
    margin: 0;
}

html, body {
    font-family: Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5
}

html {
    overflow-x: hidden
}


.panel-padding-sm {
    padding: 8px;
}

.panel-padding {
    padding: 16px;
}

.margin-bottom {
    margin-bottom: 16px !important;
}

.btn {
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    padding: 8px 16px;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
    background-color: #e0e0e0;
}

.btn:focus {
    outline: none;
}

.btn-active {
    background-color: #607d8b !important;
    color: #fff !important;
    border-color: #607d8b !important;
}

.btn-danger {
    background-color: #f44336 !important;
    color: #fff !important;
    border-color: #f44336 !important;
}

.btn-danger:hover {
    background-color: #d32f2f !important;
}

/* --- End Internal Utility Classes --- */

td {
    vertical-align: middle !important;
}

.current {
    background-color: orange !important;
}

.progress-text {
    position: absolute;
    top: 0px;
    bottom: 0px;
    padding: 5px;
    color: white;
}

.progress-bar {
    position: relative;
    background-color: rgb(12, 101, 173);
    cursor: pointer;
    width: 200px;
}

.progress-fill {
    height: 30px;
    background-color: rgb(46, 148, 231);
}

.hidden {
    display: none !important;
}

.hiddenTask {
    display: none !important;
}

.item-button {
    background-color: white;
    text-align: center;
    width: 200px;
    height: 40px;
    padding: 8px;
}

.item-button:hover {
    cursor: pointer;
    background-color: rgb(192, 192, 192);
}

button:focus {
    outline: none;
}

.scroll {
    overflow-y: auto;
}

.sidebar-element {
    margin-bottom: 16px;
}

.slidecontainer {
    width: 100%;
}

.slider {
    -webkit-appearance: none;
    width: 50%;
    height: 15px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.inline {
    display: inline-block;
}

.panel {
    background-color: white;
}

.small-margin {
    margin-bottom: 2px;
}

#logContainer {
    height: 500px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
}

.log-entry {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ccc;
    font-size: 0.95em;
}

/* --- New UI Styles (Light Mode Base) --- */

.tab-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.category-header {
    text-transform: uppercase;
    color: #555;
    margin: 25px 0 15px;
    font-size: 1.1em;
    letter-spacing: 1px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.category-content.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-content.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Card Style (Jobs, Properties) */
.ui-card {
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0px;
    width: 128px;
    text-align: center;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.ui-card:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.ui-card.active {
    border-color: #4CAF50;
    background-color: #f0f8f0;
}

.card-image {
    width: 128px;
    height: 128px;
    background-color: #eee;
    margin-bottom: 6px;
    object-fit: cover;
}

.card-title {
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 3px;
    color: #333;
    text-transform: uppercase;
}

.card-value {
    font-size: 0.9em;
    color: #b8860b;
    margin-bottom: 3px;
    font-weight: bold;
}

.card-expense {
    font-size: 0.9em;
    color: #d32f2f;
    margin-bottom: 6px;
}

/* Row Style (Skills, Misc) */
.ui-row {
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

.ui-row:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.ui-row.active {
    border-color: #4CAF50;
    background-color: #f0f8f0;
}

.row-image {
    width: 76px;
    height: 76px;
    background-color: #eee;
    margin-right: 15px;
    flex-shrink: 0;
    object-fit: cover;
}

.row-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.row-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 4px;
}

.row-value {
    font-size: 0.9em;
    color: #666;
}

.row-expense {
    font-size: 0.95em;
    color: #b8860b;
    margin-right: 15px;
    font-weight: bold;
}

/* Level Badge */
.level-badge {
    background-color: #eee;
    color: #333;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    width: 90%;
    margin: auto 10px 10px 10px;
    border: 1px solid #ccc;
}

.ui-row .level-badge {
    width: 80px;
    margin: 20px;
    text-align: center;
}

.badge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #8bc34a;
    z-index: 1;
    width: 0%;
    transition: width 0.1s linear;
}

.badge-text {
    position: relative;
    z-index: 2;
    padding: 3px 5px;
    display: block;
    text-shadow: none;
}

.potion-action {
    margin: 20px;
}

/* NEW: Locked Card and Row Styles */
.locked-card, .locked-row {
    background-color: #f5f5f5;
    border-color: #eaeaea;
    cursor: default;
}

.locked-card:hover, .locked-row:hover {
    background-color: #f5f5f5;
    border-color: #eaeaea;
}

.locked-icon {
    font-size: 40px;
    color: #ccc;
    margin-top: 15px;
}

.locked-title {
    font-size: 0.85em;
    color: #999;
    margin-top: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.locked-text {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 5px;
    padding: 0 5px;
    line-height: 1.2;
}

.locked-row .locked-icon {
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
    width: 76px;
    height: 76px;
    margin-right: 15px;
    flex-shrink: 0;
    margin-top: 0;
}

.locked-row .locked-title {
    color: #999;
    font-size: 0.9em;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 4px;
}

.locked-row .locked-text {
    color: #aaa;
    font-size: 0.9em;
    margin-top: 0;
    padding: 0;
}

/* Dynamic Text Colors for JS Injection */
.color-income-val, .color-expense-val {
    color: #b8860b;
}

.color-income-lbl {
    color: #2e7d32;
}

.color-expense-lbl {
    color: #d32f2f;
}

/* MODIFIED: Added specific background color to top-panel to contrast with tab contents */
.panel.top-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    height: 185px;
    box-sizing: border-box;
    background-color: #e2e8f0; /* Distinct slate-gray background for light mode */
    border-bottom: 2px solid #cbd5e1;
}

.tabs-container {
    display: flex;
    overflow-x: auto;
    height: 44px;
    box-sizing: border-box;
    align-items: center;
    background-color: #f8f9fa; /* Light background for tabs */
    border-bottom: 1px solid #ddd;
}

.tabButton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: none;
    font-size: 16px;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.tabButton:hover {
    background-color: #ddd;
}

.dark .tabButton:hover {
    background-color: #444;
}

/* --- Fixed Header and Scroll Container Styles --- */

.fixed-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    background-color: rgb(243, 243, 243); /* Match light theme body background */
}

.fixed-header-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
}

.main-layout-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    /* 185px (topPanel) + 44px (tabs) = 224px offset */
    padding-top: 229px;
}

.scroll-container {
    /* Viewport height minus the 224px fixed header offset */
    height: calc(100vh - 229px);
    overflow-y: overlay; /* Overlays scrollbar on content */
    scrollbar-width: thin; /* Firefox support */
    padding-bottom: 0px; /* Breathing room at the bottom */
}

/* WebKit (Chrome, Safari, Edge) Customization */
.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: transparent; /* Faded out by default */
    border-radius: 10px;
    transition: background-color 0.3s; /* Smooth transition */
}

.scroll-container:hover::-webkit-scrollbar-thumb,
.scroll-container:active::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3); /* Fades in on hover/touch */
}

/* --- Modal Styles --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darken backdrop with opacity */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-description {
    font-size: 1.05em;
    color: #555;
    margin-bottom: 10px;
}

/* NEW: Book Modal Specific Styles */
.book-modal-content {
    max-width: 800px;
    width: 90%;
    display: flex;
    gap: 20px;
    text-align: left;
}

.book-modal-left {
    flex-shrink: 0;
    width: 200px;
}

.book-modal-left img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.book-modal-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

/* Simulated Word Processor App */
.word-app-container {
    background-color: #fff;
    color: #000;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-grow: 1;
    overflow-y: auto;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1em;
    line-height: 1.6;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.blinking-cursor {
    font-weight: bold;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
