:root {
    --primary-color: #00aaff;
    --primary-hover: #0088cc;
    --primary-contrast-text: #ffffff;
    --background-color: #1a1a1a;
    --surface-color: rgba(38, 38, 38, 0.7);
    --surface-hover: rgba(55, 55, 55, 0.8);
    --text-color: #e0e0e0;
    --text-light-color: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.15);
    --danger-color: #ff4d4d;
    --danger-hover: #cc0000;
    --warning-color: #ffaa00;
    --success-color: #00cc66;
    --font-family: 'Tomorrow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --backdrop-blur: 10px;
    --transition-speed: 0.3s;
    --top-bar-height: 57px;
    --header-height: 61px;
}

body.light-mode {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #f0f2f5;
    --surface-color: rgba(255, 255, 255, 0.6);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --text-color: #333;
    --text-light-color: #777;
    --border-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    user-select: none;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.background-blur {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}
.background-blur::before, .background-blur::after {
    content: '';
    position: absolute;
    width: 30vw; height: 30vw;
    max-width: 400px; max-height: 400px;
    min-width: 200px; min-height: 200px;
    background: linear-gradient(45deg, var(--primary-color), var(--success-color));
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
    animation: pulse 15s infinite alternate;
}
.background-blur::before { top: 5%; left: 5%; }
.background-blur::after {
    bottom: 5%; right: 5%;
    background: linear-gradient(45deg, var(--warning-color), var(--danger-color));
    animation-delay: -7s;
}
@keyframes pulse {
    from { transform: scale(0.8); opacity: 0.2; }
    to { transform: scale(1.2); opacity: 0.3; }
}

main {
    padding-top: calc(var(--top-bar-height) + var(--header-height) + 2rem);
    padding-bottom: 2rem;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    height: var(--top-bar-height);
}

#app-header {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    width: 100%;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}
#app-header .header-left { justify-self: start; }
#app-header .header-center { justify-self: center; }
#app-header .header-right { justify-self: end; }
#app-header .header-controls { display: flex; align-items: center; gap: 0.5rem; }

.header-logo { height: 32px; width: 32px; }
.brand-name { font-weight: bold; font-size: 1.5rem; margin-left: 0.75rem; }
#header-title { margin: 0; font-size: 1.25rem; font-weight: normal; color: var(--text-light-color); }

button, .button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: var(--primary-contrast-text);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: var(--font-family);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
button:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
button:active { transform: scale(0.98); }
button:disabled { background-color: var(--text-light-color); cursor: not-allowed; }

.icon-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-light-color);
    width: 44px; height: 44px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}
.icon-btn:hover { background-color: var(--surface-hover); color: var(--text-color); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; }

#back-button {
    background-color: transparent;
    color: var(--text-color);
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 16px;
}
#back-button.hidden { display: none; }

#login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    padding-top: 0; /* Override body padding */
}
.login-box {
    width: 100%; max-width: 400px;
    padding: 2.5rem;
    background: var(--surface-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    border: 1px solid var(--border-color);
}
.login-box h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }

.main-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.nav-card {
    background: var(--surface-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}
.nav-card:hover { transform: translateY(-5px); background: var(--surface-hover); box-shadow: 0 12px 30px rgba(0,0,0,0.2); }
.nav-card h2 { font-size: 1.5rem; color: var(--text-color); }
.nav-card p { color: var(--text-light-color); }

#projects-grid { display: grid; grid-template-columns: repeat(var(--grid-columns, 3), 1fr); gap: 1.5rem; }
@media (max-width: 1024px) { #projects-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }

.project-cube {
    background: var(--surface-color);
    backdrop-filter: blur(var(--backdrop-blur));
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-speed) ease;
    position: relative;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.project-cube.dragging { opacity: 0.7; transform: scale(1.05); box-shadow: 0 8px 30px rgba(0,0,0,0.3); cursor: grabbing; }
.project-cube:hover { transform: translateY(-4px); background-color: var(--surface-hover); }

.project-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.project-header h3 { margin: 0; flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grab-handle { cursor: grab; color: var(--border-color); transition: color var(--transition-speed); }
.grab-handle:hover { color: var(--text-light-color); }
.grab-handle:active { cursor: grabbing; }

.project-body { flex-grow: 1; color: var(--text-light-color); }
.project-task-list { list-style: none; padding-left: 0; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.project-task-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.project-task-item.completed { text-decoration: line-through; opacity: 0.6; }
.project-task-item .icon-star { color: var(--warning-color); width: 14px; height: 14px; flex-shrink: 0; }
.project-task-item .icon-check { color: var(--success-color); width: 14px; height: 14px; flex-shrink: 0; }

.project-footer { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; margin-top: 1rem; border-top: 1px solid var(--border-color); padding-top: 1rem; }

.status-running { border-left: 4px solid var(--success-color); }
.status-needs-work { border-left: 4px solid var(--warning-color); }
.status-urgent { border-left: 4px solid var(--danger-color); }

.project-view-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .project-view-layout { grid-template-columns: 2fr 1fr; } }
#project-actions-list { display: flex; flex-direction: column; gap: 10px; }
.action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-color);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}
.action-item.dragging { opacity: 0.7; }
.action-item.completed .action-description { text-decoration: line-through; color: var(--text-light-color); }
.action-item.important { border-left: 4px solid var(--warning-color); }
.action-description { flex-grow: 1; margin: 0; }
.action-buttons { display: flex; gap: 0.25rem; }

.notes-section textarea {
    width: 100%;
    min-height: 150px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 16px;
    resize: vertical;
    transition: all var(--transition-speed) ease;
}
.notes-section textarea:focus { border-color: var(--primary-color); background-color: var(--background-color); }

.modal {
    display: none;
    position: fixed;
    z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}
@keyframes slideIn { from { transform: translateY(-30px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-light-color); cursor: pointer; padding: 0.5rem; line-height: 1; }
.close-btn:hover { color: var(--text-color); }

input[type="text"], input[type="password"], textarea {
    width: 100%;
    padding: 12px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 16px;
    transition: all var(--transition-speed) ease;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.2);
}
body.light-mode input[type="text"], body.light-mode input[type="password"] { background-color: #fff; }

.settings-section { padding: 1rem 0; border-bottom: 1px solid var(--border-color); }
.settings-section:last-child { border-bottom: none; }
.settings-section h3 { font-size: 0.9rem; color: var(--text-light-color); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.settings-option { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.layout-controls { display: flex; align-items: center; background-color: var(--surface-color); border-radius: 22px; padding: 2px; }
.layout-controls button { width: 40px; height: 40px; border-radius: 50%; background: none; color: var(--text-light-color); }
.layout-controls button.active { background-color: var(--primary-color); color: var(--primary-contrast-text); }
.user-list .user-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }

#custom-alert-message { margin: 1rem 0 2rem; color: var(--text-light-color); line-height: 1.5; }
.custom-alert-buttons { display: flex; justify-content: flex-end; gap: 1rem; }
.custom-alert-buttons .secondary { background-color: var(--surface-hover); color: var(--text-color); }
.custom-alert-buttons .secondary:hover { background-color: var(--border-color); }
.custom-alert-buttons .danger { background-color: var(--danger-color); }
.custom-alert-buttons .danger:hover { background-color: var(--danger-hover); }

footer { text-align: center; padding: 2rem; color: var(--text-light-color); font-size: 0.9rem; }
