/* --- General Styles & Modern Dark Theme --- */
:root {
    --primary-bg-color: #0d1117; /* GitHub Dark Dimmed BG */
    --secondary-bg-color: #161b22; /* GitHub Dark Dimmed secondary BG */
    --primary-text-color: #c9d1d9; /* GitHub Dark Dimmed text */
    --accent-color: #58a6ff; /* GitHub Dark Dimmed blue */
    --highlight-color: #f0f6fc; /* GitHub Dark Dimmed lighter text */
    --button-bg-color: #238636; /* GitHub green */
    --button-hover-bg-color: #2ea043; /* GitHub green hover */
    --button-text-color: #ffffff;
    --border-color: #30363d;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    background-color: var(--primary-bg-color);
    background-image: radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.1), rgba(13, 17, 23, 0.1) 30%),
                      radial-gradient(circle at 90% 80%, rgba(35, 134, 54, 0.1), rgba(13, 17, 23, 0.1) 40%);
    color: var(--primary-text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* --- Main Container --- */
.container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 95%;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--secondary-bg-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* --- Header & Main Content --- */
header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

#header-logo { width: 40px; height: 40px; }
header h1 { color: var(--highlight-color); font-size: 2.5em; margin: 0; font-weight: 600; flex-grow: 1; text-align: left; padding-left: 15px;}

.ce-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    filter: brightness(0) invert(0.9);
    pointer-events: none;
}

#header-controls {
    margin-left: auto;
}

#btn-mute-music {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--primary-text-color);
    padding: 0 15px;
}

.account-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-btn:hover {
    background-color: var(--accent-color);
    color: var(--secondary-bg-color);
    border-color: var(--accent-color);
}

main { padding: 20px 0; }

/* --- Welcome Text --- */
#welcome h2 { font-size: 2.2em; margin-bottom: 15px; color: var(--highlight-color); }

.welcome-text-container {
    max-width: 700px;
    margin: 0 auto 30px auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.welcome-text-container p {
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 1.05em;
}

.description-warning {
    color: #f8e3a1;
    border-left: 4px solid #f8e3a1;
    padding-left: 20px;
}

.description-community {
    color: var(--accent-color);
}

#motivational-quote {
    font-size: 1.2em;
    font-style: italic;
    color: var(--accent-color);
    margin: 20px auto;
    min-height: 50px;
    transition: opacity 0.5s ease-in-out;
}

/* --- Action Buttons --- */
#actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

.green-button {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    padding: 18px 50px;
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(35, 134, 54, 0.3);
}

.green-button:hover {
    background-color: var(--button-hover-bg-color);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(35, 134, 54, 0.5);
}

.green-button:active {
    transform: scale(0.98);
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.discord-hero-btn {
    background-color: #5865F2;
    color: white;
    text-decoration: none;
    padding: 18px 30px;
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.discord-hero-btn:hover {
    background-color: #4752C4;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.5);
}

.discord-hero-btn .ce-icon {
    width: 24px;
    height: 24px;
}


/* --- Site Footer (Fat Footer) --- */
.site-footer {
    background-color: #010409;
    padding: 80px 40px 40px 40px;
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 50px;
    text-align: left;
}

.footer-column h4 {
    color: var(--highlight-color);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-link {
    display: block;
    color: var(--primary-text-color);
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 0.95em;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--accent-color);
    transform: translateX(5px);
    text-decoration: underline;
}

.footer-link .ce-icon {
    display: none;
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #8b949e;
    font-size: 0.9em;
}

/* --- Overlay & Modal Styles --- */
#verifying-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(13, 17, 23, 0.95);
    z-index: 30000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.modal {
    display: none;
}
.modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 25000;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}
.modal-content {
    background: #161b22;
    padding: 30px; border: 1px solid var(--border-color);
    width: 90%; max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); animation: slideIn 0.4s ease;
    position: relative;
    z-index: 1001;
    text-align: center;
}

.account-modal-content {
    max-width: 850px;
    width: 95%;
    padding: 0;
    overflow: hidden;
    height: 650px;
    display: flex;
    flex-direction: column;
}

.account-modal-content .close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 10;
}

.split-layout {
    display: flex;
    height: 100%;
}

.split-sidebar {
    width: 35%;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: left;
}

.split-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.split-sidebar li {
    padding: 15px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s, color 0.2s;
    color: var(--primary-text-color);
    font-weight: 500;
}

.split-sidebar li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.split-sidebar li.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

.split-content {
    width: 65%;
    padding: 50px;
    overflow-y: auto;
    text-align: left;
}

.section-view {
    display: none;
}

.section-view.active {
    display: block;
}

.close-button {
    color: #8b949e; float: right; font-size: 36px; font-weight: bold; cursor: pointer; line-height: 0.7;
}
.close-button:hover { color: var(--highlight-color); }

/* Form Styles */
.modal form label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--highlight-color);
}
.modal form input, .modal form textarea, .modal-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background-color: var(--primary-bg-color);
    color: var(--primary-text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
}
.modal form input:focus, .modal form textarea:focus, .modal-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.modal-btn {
    background-color: var(--accent-color);
    color: var(--button-text-color);
    border: none; padding: 14px 20px; font-size: 1.1em; font-weight: bold;
    border-radius: 8px; cursor: pointer; transition: background-color 0.3s;
    width: 100%;
}
.modal-btn:hover { background-color: #6ab0ff; }
.modal-btn.secondary {
    background-color: #30363d;
    border: 1px solid var(--border-color);
}
.modal-btn.secondary:hover { background-color: #484f58; }

/* --- Launcher View Styles --- */
.launcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
}

.launcher-header h2 {
    color: var(--highlight-color);
    font-size: 2.2em;
    margin: 0;
}

.launcher-toolbar {
    display: flex;
    gap: 15px;
}

.launcher-btn {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95em;
    color: var(--primary-text-color);
}

.launcher-btn.green {
    background-color: var(--button-bg-color);
    border-color: var(--button-bg-color);
    color: white;
}
.launcher-btn.green:hover { background-color: var(--button-hover-bg-color); }

.launcher-btn.secondary {
    background-color: #21262d;
}
.launcher-btn.secondary:hover { background-color: #30363d; border-color: var(--accent-color); }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    background-color: var(--primary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 200px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.project-item {
    background-color: var(--secondary-bg-color);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 110px;
    position: relative;
}

.project-item:hover {
    background-color: #21262d;
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.project-item h3 {
    margin: 0;
    font-size: 1em;
    color: var(--highlight-color);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.project-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.project-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.project-action-btn.delete:hover {
    background: rgba(248, 81, 73, 0.15);
    border-color: #f85149;
}

/* --- Custom Dialog System Styles --- */
.custom-dialog {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    z-index: 40000 !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-dialog.is-open {
    display: flex !important;
    opacity: 1;
}

.dialog-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-dialog.is-open .dialog-container {
    transform: scale(1);
}

.dialog-header {
    padding: 20px 25px;
    border-bottom: 1px solid #30363d;
    font-size: 1.25em;
    font-weight: 600;
    color: #f0f6fc;
}

.dialog-content {
    padding: 25px;
    color: #c9d1d9;
    font-size: 1.05em;
    line-height: 1.5;
    text-align: left;
}

.dialog-footer {
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-radius: 0 0 12px 12px;
}

.dialog-button {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dialog-button:hover {
    background: #30363d;
    border-color: #8b949e;
}

.dialog-button.primary {
    background: #238636;
    color: white;
    border: none;
}
.dialog-button.primary:hover { background: #2ea043; }

.dialog-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    color: white;
    margin-top: 15px;
    font-size: 1em;
}
.dialog-input:focus {
    border-color: #58a6ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* --- Project Item Extra --- */
.open-folder-btn {
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.open-folder-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Keyframe Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Context Menu */
.context-menu {
    display: none !important;
    position: fixed;
    background-color: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 50000;
    min-width: 150px;
    padding: 5px 0;
}

.context-menu.visible {
    display: block !important;
}

.context-menu ul {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    color: var(--primary-text-color);
}

.context-menu li:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Utility Classes */
.visible { opacity: 1; transform: translateY(0); }
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
