/* global */
:root {
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #bb86fc;
    --primary-variant-color: #3700b3;
    --text-color: #e1e1e1;
    --text-secondary-color: #aaaaaa;
    --border-color: #2c2c2c;

    --bg-medium: #2a2a2a;
    --bg-dark: #121212;
    --text-medium: #bbbbbb;
    --text-light: #f0f0f0;
    --success-color: #03dac6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* background canvas for animated galaxy */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;  
    background: radial-gradient(ellipse at center, rgba(10,10,30,0.6), rgba(0,0,0,0.9));
}

/* container main */
.container {
    text-align: center;
    background: var(--surface-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 1; /* sit above background canvas */
}

h1 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5em;
    font-weight: 500;
}

a {
    color: #e1e1e1;
    text-decoration: underline;
}

/* upload button */
input[type="file"] {
    display: block;
    margin: 0 auto 25px auto;
    color: var(--text-secondary-color);
}

input[type="file"]::file-selector-button {
    background-color: var(--primary-variant-color);
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--primary-color);
}

/* secondary button style (used by How-to button) - match file selector button */
.secondary {
    background-color: var(--primary-variant-color);
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    font-size: 1em;
}
.secondary:hover {
    background-color: var(--primary-color);
}

/* main button */
button {
    width: 60%;
    padding: 12px 20px;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

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

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #404040;
    color: #757575;
    cursor: not-allowed;
}

/* status */
#status {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-secondary-color);
    height: 20px;
}


/* donate shit style */
#donation-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-medium);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
    padding: 20px 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transform: translateY(100%); 
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* visible pop-up */
#donation-popup.popup-visible {
    transform: translateY(0);
    opacity: 1;
}

#close-popup-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 2.5em;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    width: auto;  
}

#donation-popup h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

#donation-popup p {
    font-size: 0.9em;
    max-width: 600px;
    margin: 0 auto 15px;
    color: var(--text-secondary-color);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    margin: 0 auto 5px;
    color: var(--text-medium);
    max-width: 400px;
}

.progress-bar-container {
    width: 100%;
    max-width: 400px;
    height: 12px;
    background-color: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin: 0 auto 20px;
    overflow: hidden;
}

#progress-bar-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}

.donate-button {
    display: inline-block;
    width: auto;
    padding: 10px 30px;
    text-decoration: none;
    margin: 0 auto;
    font-size: 1.1em;
    font-weight: bold;
    background-color: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.donate-button:hover {
    background-color: var(--success-color);
    transform: translateY(-2px);
}

/* how-to modal styles */
#howto-modal.modal-hidden { display: none; }
#howto-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-card { position: relative; background: var(--surface-color); color: var(--text-color); padding: 20px 22px; border-radius: 10px; width: 92%; max-width: 720px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); z-index: 1; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--text-secondary-color); font-size: 1.6em; cursor: pointer; }
.modal-card h2 { margin-top: 0; }
.modal-card ol { text-align: left; margin-left: 1.1em; }

/* how-to modal styles */
.modal-hidden { display: none; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1001;
}
.modal-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 20px 24px;
    max-width: 640px;
    width: calc(100% - 48px);
    border-radius: 10px;
    z-index: 1002;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.modal-card h2 { margin-top: 0; }
.modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary-color);
    font-size: 1.6em;
    cursor: pointer;
}
