:root {
    --rosewater: #f5e0dc;
    --flamingo: #f2cdcd;
    --pink: #f5c2e7;
    --mauve: #cba6f7;
    --red: #f38ba8;
    --maroon: #eba0ac;
    --peach: #fab387;
    --yellow: #f9e2af;
    --green: #a6e3a1;
    --teal: #94e2d5;
    --sky: #89dceb;
    --sapphire: #74c7ec;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --text: #cdd6f4;
    --subtext1: #bac2de;
    --subtext0: #a6adc8;
    --overlay2: #9399b2;
    --overlay1: #7f849c;
    --overlay0: #6c7086;
    --surface2: #585b70;
    --surface1: #45475a;
    --surface0: #313244;
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--base);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

h1 {
    color: var(--mauve);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
}

/* Login Container */
#login-container {
    background-color: var(--mantle);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

#login-container h2 {
    color: var(--blue);
    margin-bottom: 1rem;
    text-align: center;
}

/* Dashboard */
#dashboard {
    background-color: var(--mantle);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

#console {
    background-color: var(--crust);
    border-radius: 8px;
    padding: 1rem;
    height: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#logs {
    flex-grow: 1;
    overflow-y: auto;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    color: var(--subtext0);
    white-space: pre-wrap;
    padding-right: 5px;
}

/* Custom Scrollbar */
#logs::-webkit-scrollbar {
    width: 8px;
}
#logs::-webkit-scrollbar-track {
    background: var(--mantle);
}
#logs::-webkit-scrollbar-thumb {
    background: var(--surface2);
    border-radius: 4px;
}

/* Inputs & Buttons */
input {
    background-color: var(--surface0);
    border: 1px solid var(--surface1);
    color: var(--text);
    padding: 0.8rem 1rem;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--mauve);
}

button {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
    color: var(--base);
}

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

#login-btn { background-color: var(--mauve); }
#start-btn { background-color: var(--green); }
#stop-btn { background-color: var(--red); }
#restart-btn { background-color: var(--peach); }

#command-input {
    width: 100%;
    margin-top: 10px;
}

/* Mod Management */
#mod-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--overlay1);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface1);
}

.mod-item {
    border-bottom: 1px dashed var(--surface1);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.mod-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.mod-size {
    font-size: 0.8rem;
    color: var(--overlay0);
    margin-top: 4px;
}

#drop-zone {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

#drop-zone::after {
    content: '☁️ Drop your .jar files here to upload';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 30, 46, 0.95); /* var(--base) with opacity */
    color: var(--mauve);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px dashed var(--mauve);
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

#drop-zone.drag-over::after {
    opacity: 1;
}

.upload-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Fix mobile overflow */
}
.upload-controls input {
    flex-grow: 1;
    min-width: 0; /* Prevent input from pushing layout out */
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    #app {
        padding: 10px;
    }
    #console {
        height: 300px;
    }
    #controls {
        grid-template-columns: 1fr;
    }
}
