@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  /* Make sure there are NO quotes around the URL if it's acting up */
  src: url(libs/webfonts/fa-solid-900.woff2) format('woff2');
}

@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-style: normal;
  font-weight: 400; /* Brands usually use 400 */
  font-display: block;
  src: url(libs/webfonts/fa-brands-400.woff2) format('woff2');
}

/* Then make sure the .fab class uses this font family */
.fab {
    font-family: 'Font Awesome 6 Brands' !important;
}

/* --- BASE STYLES --- */
body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background: #fff; 
    overflow: hidden; 
}

/* Pre-load Font Awesome so it's ready for the 3D Canvas */
body::after {
    content: "\uf111";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#3d-graph {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* --- NAVIGATION & TOP ACTIONS --- */
#navbar {
    position: absolute; top: 0; left: 0; width: 100%; height: 70px;
    background: white; display: flex; align-items: center; padding: 0 20px;
    border-bottom: 1px solid #e0e0e0; z-index: 1000; box-sizing: border-box;
}

#logo { width: 180px;  object-fit: contain; margin-right: 15px; }

.top-actions {
    position: absolute; top: 15px; right: 20px; z-index: 1001;
    display: flex; gap: 8px;
}

/* --- UI PANEL & TRANSITIONS --- */
#ui-panel {
    position: absolute; top: 85px; left: 15px; z-index: 100;
    background: rgba(255, 255, 255, 0.98); padding: 35px 20px 20px 20px; 
    border-radius: 10px; width: 285px; border: 1px solid #e0e0e0; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    max-height: calc(90vh - 85px); overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

#ui-panel.collapsed {
    transform: translateX(-250px); /* Fully hides panel off-screen */
}

/* 2. Standard Scrollbar for Firefox */
#ui-panel {
    scrollbar-width: thin;
    scrollbar-color: #e6e6e6 transparent;
}

/* 3. Chrome, Safari, and Edge */
#ui-panel::-webkit-scrollbar {
    width: 6px; /* Narrow and fixed */
}

#ui-panel::-webkit-scrollbar-track {
    background: transparent; /* No background for the track */
}

#ui-panel::-webkit-scrollbar-thumb {
    background-color: #cccccc; /* Light grey bar */
    border-radius: 10px;       /* Rounded ends */
}

#ui-panel::-webkit-scrollbar-thumb:hover {
    background-color: #aaaaaa; /* Darkens slightly when you touch it */
}




/* --- FORM ELEMENTS --- */
label { 
    font-size: 11px; font-weight: bold; color: #666; 
    text-transform: uppercase; display: block;
}

input, select, textarea { 
    width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ddd; 
    border-radius: 8px; outline: none; box-sizing: border-box; font-family: inherit;
}

textarea { height: 80px; resize: vertical; font-size: 13px; }

button { 
    width: 100%; padding: 10px; margin: 5px 0; cursor: pointer; 
    background: #2196F3; color: white; border: none; border-radius: 8px; 
    font-weight: 600; transition: 0.2s; 
}
button:hover { opacity: 0.9; }

.action-btn {
    padding: 8px 14px; background: white; border: 1px solid #ddd;
    border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: bold;
    color: #555; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: all 0.2s;
    width: auto; 
}
.action-btn:hover { border-color: #2e7d32; color: #2e7d32; transform: translateY(-1px); }

.secondary { background: #455A64; }
.danger { background: #f44336; font-size: 10px; margin-top: 20px; }
.pdf-btn { background: #f3e5f5; }
.pdf-btn:hover { border-color: #673AB7; color: #673AB7; }

/* --- SPECIALIZED UI CONTROLS --- */
.search-section { 
    background: #f8f9fa; padding: 10px; border-radius: 10px; 
    margin-bottom: 10px; border: 1px solid #eee; 
}

.edit-box { 
    position: relative; border: 2px solid #ff9800; padding: 12px; 
    margin-top: 15px; display: none; background: #fffcf5; border-radius: 10px; 
}

.delete-icon {
    position: absolute; top: 10px; right: 10px; color: #f44336;
    cursor: pointer; font-size: 18px; transition: transform 0.2s;
}
.delete-icon:hover { transform: scale(1.2); color: #d32f2f; }

#collapse-btn {
    position: absolute; top: 10px; right: 10px; cursor: pointer;
    font-size: 16px; color: #aaa; transition: all 0.3s ease; z-index: 1001;
    width: 40px; height: 40px; display: flex; align-items: center;
    justify-content: center; border-radius: 50%;
}
#collapse-btn:hover { color: #2196F3; background: #f5faff; }

/* --- BORDER WIDTH & COLOR SWATCHES --- */
.range-labels {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 10px; color: #888; margin-bottom: 2px; padding: 0 2px;
}

.range-labels label { margin-bottom: 0; } /* Reset label margin for inline use */

.inline-controls {
    display: flex; align-items: center; gap: 12px; margin: 4px 0;
}

#editBorderWidth { flex-grow: 1; cursor: pointer; }

/* Combined square-picker and color-swatch logic */
.square-picker, .color-swatch {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    overflow: hidden;
    transition: transform 0.1s;
}

.square-picker::-webkit-color-swatch-wrapper, .color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.square-picker::-webkit-color-swatch, .color-swatch::-webkit-color-swatch { border: none; }
.square-picker::-moz-color-swatch, .color-swatch::-moz-color-swatch { border: none; }

.square-picker:hover, .color-swatch:hover {
    transform: scale(1.1);
    border-color: #2e7d32;
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
}

/* --- OVERLAYS & MODALS --- */
#zoom-controls {
    position: absolute; bottom: 30px; right: 30px;
    display: flex; flex-direction: column; gap: 10px; z-index: 1000;
}

#zoom-controls button {
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.85); color: #333; border: 1px solid #ddd;
    font-size: 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center; padding: 0;
}

#save-indicator {
    position: absolute; top: 85px; right: 20px;
    background: rgba(46, 125, 50, 0.9); color: white;
    padding: 8px 15px; border-radius: 20px; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; z-index: 2000;
    pointer-events: none; opacity: 0; transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

#save-indicator.show { opacity: 1; transform: translateY(0); }

#json-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}

.modal-content { 
    background-color: #fefefe; margin: 5% auto; padding: 20px; 
    border-radius: 12px; width: 60%; height: 70%; display: flex; flex-direction: column; 
}

pre { 
    background: #272822; color: #f8f8f2; padding: 15px; border-radius: 8px; 
    overflow: auto; flex-grow: 1; font-family: 'Courier New', monospace; font-size: 12px; 
}


.modal-overlay {
    position: fixed;
    z-index: 3000; /* Higher than other panels */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#options-container label {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #455A64;
    display: block;
}

#options-container .secondary {
    background: #546E7A; /* A slightly softer grey-blue for internal tools */
}

#options-container .pdf-btn {
    background: #673AB7; /* A deep purple to indicate "Export" */
    color: white;
    border: none;
    margin-top: 5px;
}

#options-container .pdf-btn:hover {
    background: #5e35b1;
    opacity: 1;
    transform: translateY(-1px);
}

#options-container .danger {
    background: #f44336;
    color: white;
    margin-top: 5px;
    font-size: 12px;
}

#options-container .danger:hover {
    background: #d32f2f;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}


/* Solid icons (pencil, trash, etc.) */
.fas, .fa-solid {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900;
}

/* Brand icons (Discord, etc.) */
.fab, .fa-brands {
    font-family: 'Font Awesome 6 Brands' !important;
    font-weight: 400;
}

/* If the icons are inside your edit boxes, target ONLY the placeholder or a specific class */
.edit-box-icon {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900;
}

.discord-link {
    color: #7289da; /* Discord Blue */
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    margin-top: 10px;
}

.discord-link:hover {
    transform: scale(1.1);
    color: #5b70be; /* Slightly darker on hover */
}


#projectNameInput {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box; /* Ensures padding doesn't push it off-screen */
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Adds a subtle blue glow when clicked, making it feel "active" */
#projectNameInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}


.main-footer {
    position: fixed;
    bottom: 20px;       /* Gap from the bottom */
    left: 50%;          /* Center horizontally */
    transform: translateX(-50%); /* Perfect centering alignment */
    z-index: 1000;      /* Higher than the 3D canvas */
    background: rgba(255, 255, 255, 0.7); /* Semi-transparent white */
    padding: 8px 20px;
    border-radius: 20px; /* Rounded pill shape looks more modern */
    backdrop-filter: blur(5px); /* Blurs the map behind it for readability */
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-footer a {
    color: #2e7d32;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.main-footer a:hover {
    text-decoration: underline;
}


/* Styling the preview to look like a button */
#iconPreview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}
    #iconPreview:hover {
        background: #f0f7f0;
        transform: scale(1.1);
        border-color: #2e7d32;
    }

    /* The Icon Picker Modal */
    .icon-modal {
        display: none; 
        position: fixed; 
        z-index: 10000; 
        left: 0; top: 0; width: 100%; height: 100%;
        background-color: rgba(0,0,0,0.5);
        justify-content: center; align-items: center;
    }
    .icon-modal-content {
        background: white;
        padding: 24px;
        border-radius: 16px;
        width: 450px;
        text-align: center;
        box-shadow: 0 15px 35px rgba(0,0,0,0.3);
        max-height: 90vh;
        overflow-y: auto;
    }
    .icon-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 8px;
        margin-top: 20px;
    }
    .icon-option {
        font-family: "Font Awesome 6 Free"; /* */
        font-weight: 900; /* Required for 'Solid' icons to render */
        font-size: 24px;
        padding: 10px;
        cursor: pointer;
        text-align: center;
    }
    .icon-option:hover {
        background: #e8f5e9;
        color: #2e7d32;
    }

    /* Add this to your index.html styles */
.icon-update-flash {
    animation: flash-green 0.5s;
}

@keyframes flash-green {
    0% { background-color: #ffffff; }
    50% { background-color: #c8e6c9; }
    100% { background-color: #fdfdfd; }
}

    /* Force the Select and its Options to use Font Awesome Solid */
    #editIcon {
        font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Solid', sans-serif !important;
        font-weight: 900 !important;
    }

    /* Ensure the options specifically inherit the weight needed for Solid icons */
    #editIcon option {
        font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Solid', sans-serif !important;
        font-weight: 900 !important;
        font-size: 18px;
    }

    .switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    text-transform: none;
    margin-bottom: 15px;;
}

    /* Simple toggle slider styling */
    .slider {
        width: 34px;
        height: 18px;
        background-color: #ccc;
        border-radius: 20px;
        position: relative;
        transition: .3s;
    }

    .slider:before {
        content: "";
        position: absolute;
        height: 14px;
        width: 14px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        border-radius: 50%;
        transition: .3s;
    }

input:checked + .slider { background-color: #2e7d32; }
input:checked + .slider:before { transform: translateX(16px); }
#animateAllToggle { display: none; }


#user-nav {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    margin-left: 15px; /* Space between coffee button and login */
    z-index: 10000;
}

.user-initials-circle {
    width: 40px;
    height: 40px;
    background-color: #2e7d32;
    color: #ffffff !important; /* Force white text */
    border-radius: 50%;
    
    /* CRITICAL FOR INITIALS: */
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    font-weight: 800;
    font-size: 14px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    text-align: center;
    line-height: 1; /* Prevents text from shifting down */
}

/* Style for the 'Login' link to match your buttons */
.login-link {
    color: #2e7d32;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #2e7d32;
    border-radius: 5px;
    transition: 0.3s;
}

.login-link:hover {
    background: #2e7d32;
    color: white;
}

#toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.toast {
    background: #2e7d32; /* TreeHugr Green */
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: sans-serif;
    transform: translateX(-150%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

/* Samples Modal Overlay */
#samplesModal.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 3000; /* Above the 3D graph and navbar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Modal Content Box */
#samplesModal .modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 650px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
}

/* The Grid for Sample Cards */
.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.sample-card {
    background: #f9fbf9;
    border: 2px solid #e0ede0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.sample-card:hover {
    background: #2e7d32;
    border-color: #1b5e20;
    transform: translateY(-3px);
}

.sample-card:hover i, .sample-card:hover span {
    color: #ffffff !important;
}

.sample-card i {
    font-size: 2.5rem;
    color: #2e7d32;
    margin-bottom: 10px;
    display: block;
}

/* Burger Menu Container */
.menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1002;
}

/* The Button itself */
.burger-menu-btn {
    background: white;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px; 
    width: 38px;
    height: 32px; /* Adjusted height to match button padding/font-size better */
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.burger-menu-btn:hover {
    transform: translateY(-1px);
    background: #f5f5f5;
    border-color: #2e7d32;
    color: #2e7d32;
}

/* Dropdown Content (Hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    padding: 8px 0;
    border: 1px solid #eee;
}

/* Individual Menu Items */
.menu-item {
    padding: 12px 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.menu-item i {
    width: 20px;
    text-align: center;
    color: #666;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item hr {
    margin: 8px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* Show class for JS toggle */
.show-menu {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}