/* Global styles for a dark, futuristic theme */
body {
    font-family: 'Poppins', sans-serif; /* Modern, clean sans-serif */
    background-color: transparent; /* Allows the #bg-universe canvas to be visible */
    color: #e5e7eb; /* Light grey for text against dark background */
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Canvas for the immersive universe background */
#bg-universe {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none; /* Allows clicks to pass through to elements below */
}

/* Main content area, elevated above the background */
#app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: 60px; /* Space for fixed header */
}

/* Navigation bar */
.main-nav {
    background: rgba(17, 25, 40, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.nav-link {
    color: #93c5fd; /* Light cyan for links */
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}
.nav-link:hover, .nav-link.active {
    color: #bfdbfe; /* Lighter cyan on hover */
    background-color: rgba(6, 182, 212, 0.15); /* Subtle light cyan background */
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.6); /* Soft glow */
}
.nav-link.active {
    border-bottom: 2px solid #06b6d4; /* Active indicator */
}

/* Cards: Sleek glassmorphism with gradient border and sparkle effect */
.card {
    background: rgba(17, 25, 40, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(135deg, #06b6d4, #e879f9); /* Cyan to magenta gradient border */
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    transform-style: preserve-3d; /* For 3D tilt */
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 204, 255, 0.18), 0 10px 25px rgba(0,0,0,0.45);
}

/* Sparkle effect styles */
.sparkle-star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle-fade-out 0.8s forwards;
}
@keyframes sparkle-fade-out {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(3); }
}

/* Buttons: Radiant glow effect */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #e879f9 100%); /* Blue to magenta gradient */
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 8px 18px rgba(37,99,235,0.35);
    transition: all 0.25s ease;
}
.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 26px rgba(232, 121, 249, 0.45), 0 6px 14px rgba(37,99,235,0.35);
}

/* Forms and inputs */
.form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.form-control:focus {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #06b6d4; /* Cyan focus glow */
    box-shadow: 0 0 0 0.25rem rgba(6, 182, 212, 0.25);
    color: #e5e7eb;
}
.form-control::placeholder {
    color: #94a3b8;
}

/* Tables */
.table {
    background-color: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}
.table thead th {
    border-bottom: 2px solid rgba(148, 163, 184, 0.25) !important;
    color: #bfdbfe;
}
.table tbody td, .table thead th {
    border-color: rgba(148, 163, 184, 0.1) !important;
}
.table-bordered {
    border: 1px solid rgba(148, 163, 184, 0.1) !important;
}

/* Alerts (for error messages) */
.alert-danger {
    background-color: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid #dc2626;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Woody theme accents for mantras */
.wood-card {
    background: rgba(47, 35, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.35);
}
.wood-list .list-group-item {
    background: rgba(51, 40, 28, 0.55);
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.75rem;
    margin-bottom: 0.6rem;
    backdrop-filter: blur(6px);
}
.wood-item.card {
    border-radius: 0.75rem;
    position: relative;
}
.wood-item.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit; /* aligns the gradient outline to the card radius */
    padding: 1px; /* outline thickness */
    background: linear-gradient(135deg, rgba(219, 191, 137, 0.6), rgba(255, 201, 142, 0.35));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
.drag-handle { cursor: grab; }
.dragging { opacity: 0.75; }

/* Active goal highlight shimmer */
.wood-item.card:hover::after {
    content: "";
    position: absolute;
    top: -30%;
    left: -30%;
    width: 60%;
    height: 160%;
    transform: rotate(25deg);
    background: radial-gradient(closest-side, rgba(255, 223, 186, 0.35), rgba(255, 223, 186, 0) 70%);
    filter: blur(10px);
    animation: shimmer 1.2s ease-out;
    border-radius: inherit;
}
@keyframes shimmer {
    0% { transform: translateX(-50%) rotate(25deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(220%) rotate(25deg); opacity: 0; }
}