/* --- Dark Landing Page Styles --- */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow: auto;
    /*height: 100vh; /* Ensures the body fills the entire screen height */
    background-color: #1e1e1e; /* Sets a default dark background */
}

#landing-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #1e1e1e; /* Dark background */
    color: #f0f0f0; /* Light text */
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #2e2e2e; /* Slightly lighter dark shade */
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 2rem;
}

.logo img {
    height: 128px;
}

.social-links a {
    font-size: 1.2rem;
    text-decoration: none;
    color: #f0f0f0;
}

.landing-main {
    display: flex;
    justify-content: space-between;
    padding: 2rem;
    max-width: 1100px;
    margin: auto;
    gap: 2rem;
    flex-grow: 1;
}

.hero {
    flex: 1;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #aaa; /* Lighter grey for subtitle */
    margin-bottom: 1rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #4e89ff;
    color: #fff;
}

.btn-secondary {
    background: #4a4a4a; /* Darker grey for secondary button */
    color: #f0f0f0;
    border: 1px solid #666;
}

.quick-info {
    flex: 1;
    background: #2e2e2e; /* Dark background for info box */
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.quick-info h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.quick-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-info li {
    padding: 0.4rem 0;
}

.gallery {
    text-align: center;
    padding: 1rem 2rem;
}

.gallery-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-grid img {
    width: 200px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    font-size: 0.85rem;
    background: #252525; /* Dark footer background */
    border-top: 1px solid #4a4a4a;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
}

.footer-right {
    max-width: 600px;   /* Forces the text to wrap. Adjust this value as needed. */
    text-align: right;  /* Aligns the wrapped text to the right. */
    font-size: 0.75rem; /* Makes the long text slightly smaller */
    color: #999;       /* Fades the text slightly */
}

.footer-sub-links {
    margin-top: 0.5rem; /* Adds a little space above the Terms/Privacy links */
}

.landing-footer a {
    text-decoration: none;
    color: #ccc; /* Light grey for footer links */
    margin-left: 1rem;
}

@media (max-width: 768px) {
    .landing-main {
        flex-direction: column;
        padding: 1rem;
    }
    .gallery-grid {
        flex-direction: column;
        align-items: center;
    }
    .landing-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }
    .landing-footer a {
        margin: 0 0.5rem;
    }
}

#landing-page {
    position: relative;
    overflow: hidden;
    isolation: isolate; 
}

.decorative-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.decorative-container img {
    position: absolute;
    opacity: 0.4; /* Adjust this value for fading */
    mix-blend-mode: plus-lighter; 
}

/* "Move Clockwise" */
.decorative-container img:nth-of-type(1) {
    bottom: 35%;
    left: 5%;
    width: 300px;
    transform: rotate(-20deg);    
}

/* "Enrage" */
.decorative-container img:nth-of-type(2) {
    bottom: 5%;
    left: 28%;
    width: 120px;
    transform: rotate(10deg);
}

/* "Timeline" */
.decorative-container img:nth-of-type(3) {
    top: 25%;
    right: 5%;
    width: 280px;
}

/* "DPS Check" */
.decorative-container img:nth-of-type(4) {
    top: 50%;
    right: 8%;
    width: 180px;
}

/* "Tank Buster" */
.decorative-container img:nth-of-type(5) {
    bottom: 12%;
    right: 46%;
    width: 330px;
    transform: rotate(15deg);
}

.landing-header, .landing-main, .landing-footer {
    position: relative;
    z-index: 1;
}


/* --- Your Existing Application Styles --- */
#app-container {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    color: #f0f0f0;
    font-family: sans-serif;
}

#toolbar {
    width: 120px;
    padding: 10px;
    background-color: #2e2e2e;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    gap: 5px;
}

#tool-options {
    position: absolute;
    left: 140px;
    top: 10px;
    display: none;
    width: auto;
    min-width: 160px;
    padding: 10px;
    background-color: #252525;
    border: 1px solid #4a4a4a;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#canvas-container {
    flex-grow: 1;
    position: relative;
    background-color: #262629;
    overflow: hidden;
}

#konva-container {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#bottom-bar {
    height: 60px;
    background-color: #2e2e2e;
    border-top: 1px solid #4a4a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

#page-controls, #action-buttons, #page-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
}

#page-tabs button, #page-controls button, #action-buttons button {
    padding: 5px 10px;
    font-size: 12px;
    height: 30px;
}

#page-controls .delete-btn {
    background-color: #8B0000;
    width: 30px;
}

#page-controls #add-page-btn {
    width: 30px;
}

#page-controls #copy-page-btn, #page-controls #paste-page-btn {
    width: auto;
    padding: 0 8px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

button, .button-link {
    padding: 8px 5px;
    background-color: #4a4a4a;
    color: white;
    border: 1px solid #666;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

button:hover, .button-link:hover {
    background-color: #5a5a5a;
}

button:disabled {
    background-color: #3a3a3a;
    color: #888;
    cursor: not-allowed;
}

button.active {
    background-color: #0078d4;
    border-color: #005a9e;
}

.full-width-btn {
    width: 100%;
}

.tool-group-btn {
    height: 45px;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
}

.tool-group-btn img {
    height: 24px;
    max-width: 36px;
    object-fit: contain;
    margin-bottom: 2px;
}

.tool-options-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tool-options-group h4 {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #4a4a4a;
    font-size: 14px;
}

.tool-options-group button {
    width: 100%;
    height: 32px;
    justify-content: flex-start;
    gap: 8px;
}

.tool-options-group button img {
    height: 20px;
    width: 20px;
    object-fit: contain;
}

.fill-toggle {
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 12px;
    background-color: #3a3a3a;
    border-radius: 15px;
    padding: 2px;
    cursor: pointer;
    height: 24px;
}

.fill-toggle span {
    padding: 2px 10px;
    border-radius: 12px;
}

.fill-toggle span.active {
    background-color: #5a5a5a;
}

.color-palette button {
    width: 100%;
    height: 20px;
    padding: 0;
}

.color-palette button.active {
    outline: 2px solid #FFFF00;
    outline-offset: 1px;
}

.label {
    margin: 8px 0 4px 0;
    font-size: 13px;
}

.separator {
    border: none;
    height: 1px;
    background-color: #4a4a4a;
    margin: 10px 0;
}

.footer {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bug-report {
    background-color: #1a4a1a;
}

.kofi {
    background-color: #29abe0;
}

.modal-backdrop, .modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal, .modal-content {
    background-color: #2e2e2e;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #f0f0f0;
}

.modal input {
    padding: 8px;
    background: #444;
    border: 1px solid #666;
    color: white;
    width: 100%;
    box-sizing: border-box;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#connection-status {
    font-style: italic;
    color: #aaa;
    text-align: center;
}

/* --- side-panel.css and aether-text-editor styles --- */
#editor-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    background-color: #1e1e1e;
    border-left: 1px solid #444;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
    color: #ccc;
}

#editor-side-panel.is-visible {
    transform: translateX(0);
}

#editor-side-panel h3 {
    margin-top: 0;
    color: white;
    text-align: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

#editor-side-panel .panel-section {
    margin-bottom: 20px;
}

#editor-side-panel label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #aaa;
}

#editor-side-panel .font-size-controls button {
    padding: 5px 10px;
    margin-right: 5px;
    background-color: #333;
    border: 1px solid #555;
    color: #ccc;
    cursor: pointer;
}

#editor-side-panel .font-size-controls button.active {
    background-color: #007acc;
    border-color: #007acc;
    color: white;
}

#editor-side-panel #side-panel-textarea {
    width: 100%;
    height: 150px;
    background-color: #2a2a2a;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px;
    box-sizing: border-box;
    resize: vertical;
}

#editor-side-panel #confirm-text-changes-btn {
    width: 100%;
    padding: 10px;
    background-color: #2a8c4a;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
}

#editor-side-panel #confirm-text-changes-btn:hover {
    background-color: #3aa05d;
}

#inplace-text-overlay {
    position: absolute;
    display: none;
    background: rgba(40, 40, 40, 0.9);
    border: 1px dashed #00a1ff;
    padding: 0;
    margin: 0;
    resize: none;
    overflow: hidden;
    white-space: pre;
    z-index: 1001;
}

.aether-text-editor {
    position: absolute;
    z-index: 100;
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.aether-text-editor textarea {
    background-color: #222;
    color: #eee;
    border: 1px solid #555;
    border-radius: 2px;
    resize: none;
    width: 250px;
    height: 80px;
}

.aether-text-editor .editor-buttons {
    display: flex;
    gap: 5px;
}

#live-btn {
    background-color: #9fe466;
    color: #1e1e1e; /* Dark text for better contrast */
    font-weight: bold;
    border-color: #a39049;
}

#live-btn:hover {
    background-color: #d4c16a;
}

#connection-status.status-connected {
    color: #20c2a8; /* Greenish-blue */
}

#connection-status.status-disconnected {
    color: #ff6b4e; /* Orange-red */
}

#connection-status.status-connecting {
    color: #f0f0f0; /* Default light text */
}

button.sticky-active {
    background-color: orange !important; /* Use !important to override other styles */
    border-color: #cc8400;
}

.sticky-toggle {
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 12px;
    background-color: #3a3a3a;
    border-radius: 15px;
    padding: 2px;
    cursor: pointer;
    height: 24px;
}

.sticky-toggle span {
    padding: 2px 10px;
    border-radius: 12px;
}

.sticky-toggle span.active {
    background-color: #5a5a5a;
}

.sticky-toggle.sticky-active {
    background-color: orange;
    border: 1px solid #cc8400;
}