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

body {
    background-image: url('/images/abstract-gradient-image.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;

    overflow: hidden;

    
}
/* --- New 3D Wrapper --- */
.perspective-wrapper {
    /* These properties are moved from the body */
    perspective: 1500px;
    
    /* These ensure it still fills the screen */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Hide any overflow from the 3D stage */
}

#stage {
   
    width: 100%;
    height: 100vh;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.preset-buttons {
    position: fixed; /* Use fixed positioning */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%); /* This centers it */
    z-index: 9998; /* A high number to keep it on top */
    display: flex;
    gap: 10px;
}
.preset-buttons button {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.3);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}


.hidden {
    display: none !important;
}

.action-buttons-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/* --- UI Overlay Buttons (Corrected) --- */

/* This is a generic style for how ALL action buttons should look */
.action-btn {
    position: fixed; /* Position relative to the window */
    z-index: 1001;   /* A high number to keep it on top */
    
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(25deg);
}


/* --- Specific Positioning for EACH Button --- */

/* Position for the Settings (Gear) Button */
#settings-btn {
    bottom: 20px;
    right: 20px; 
}

/* Position for the Reorganize (Wand) Button */
#reorganize-btn {
    bottom: 85px; /* Place it 85px from the bottom (50px for the button + 15px gap + 20px base) */
    right: 20px;
}

/* --- Settings Panel --- */
#settings-panel {
    position: fixed;
    top: 0;
    right: -400px; /* Start it 400px off-screen to the right */
    width: 400px;
    height: 100%;
    z-index: 1000;
    
    background: rgba(30, 30, 30, 0.5); /* A slightly darker glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Smooth sliding animation */
}

/* This class will be added by JavaScript to show the panel */
#settings-panel.is-open {
    right: 0; /* Slide it into view */
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
    font-weight: 500;
}

#settings-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
}
#settings-close-btn:hover {
    opacity: 1;
}

.settings-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

/* --- AI Reorganization Modal --- */
#reorganize-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* A dark overlay */
    backdrop-filter: blur(5px);
    z-index: 9999;
    
    display: flex;
    justify-content: center;
    align-items: center;
}

#reorganize-modal {
    background: rgba(40, 40, 40, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative; /* For the cancel button */
    text-align: center;
}

#reorganize-modal h3 { font-size: 1.5rem; margin-bottom: 10px; }
#reorganize-modal p { font-size: 1rem; color: rgba(255,255,255,0.6); margin-bottom: 25px; }

#reorganize-form { display: flex; flex-direction: column; gap: 15px; }

#reorganize-form input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    color: white; padding: 12px; border-radius: 8px;
    outline: none; font-size: 1.1rem; text-align: center;
}

#reorganize-form button {
    background: rgba(90, 120, 255, 0.6);
    border: none; color: white; padding: 12px;
    border-radius: 8px; cursor: pointer; font-size: 1.1rem;
}

#reorganize-cancel-btn {
    position: absolute;
    top: 10px; right: 15px; background: none; border: none;
    color: white; font-size: 2rem; cursor: pointer; opacity: 0.7;
}


[class*="ph-"] {
    font-family: "Phosphor-Fill", "Phosphor", sans-serif !important;
}


.action-btn img,
.account-btn img.user-silhouette {
    width: 60%;
    height: 60%;
    filter: invert(1);
}

/* --- Onboarding Tour --- */


#tour-tooltip {
    position: fixed;
    background: rgba(30, 30, 30, 0.9); 
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 20px;
    border-radius: 12px;
    z-index: 9992;
    width: 300px;
    max-width: 90vw; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease-out;
}

#tour-tooltip-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

#tour-next-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(90, 120, 255, 0.7);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

#tour-arrow {
    position: fixed;
    width: 50px;
    height: 50px;
    z-index: 9991;
    pointer-events: none; 
    transition: all 0.3s ease-out;
}

#tour-arrow img {
    width: 100%;
    height: 100%;
    filter: invert(1); 
}

#tour-tooltip {
    position: fixed;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    z-index: 9992;
    width: 300px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#tour-tooltip-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

#tour-next-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(90, 120, 255, 0.7);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}


#tour-overlay.cutout-mode {
    background: transparent; 

    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);

    clip-path: polygon(

        -1px -1px, 9999px -1px, 9999px 9999px, -1px 9999px, -1px -1px,

        0 0, 0 0, 0 0, 0 0
    );
}

/* --- Settings Panel Tabs --- */

.settings-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 20px;
}
.tab-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    top: 1px; 
}
.tab-link.is-active {
    color: white;
    font-weight: 500;
    border-bottom: 2px solid white;
}

.tab-content {
    display: none;
}

.settings-content > .tab-content.is-active {
    display: block;
}


.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.theme-item {
    cursor: pointer;
    text-align: center;
}
.theme-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}
.theme-item:hover .theme-thumbnail {
    border-color: rgba(90, 120, 255, 0.8);
}
.theme-item span {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
}

.account-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;

    align-items: center;
    transition: transform 0.2s ease;
}

.account-btn:hover {
    transform: scale(1.1);
}

.account-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.account-btn .user-silhouette {
    filter: invert(1);
    width: 60%;
    height: 60%;
}

.account-dropdown {
    position: fixed;
    top: 75px;
    left: 20px;
    z-index: 1000;
    width: 280px;
    padding: 20px;
    background: rgba(30,30,30,0.7);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important; /* Force text to be white */
    opacity: 1 !important;   /* Force it to be fully opaque */
    visibility: visible !important; /* Force it to be visible */
}

.account-dropdown h4 {margin: 0 0 5px 0;}
.account-dropdown p { font-size: 0.9rem; opacity: 0.7; margin: 0 0 15px 0; }
.account-dropdown button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(90, 120, 255, 0.6);
    color: white;

    cursor: pointer;

}

#login-modal-overlay {
    position: fixed;
    top: 0; left:0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
#login-modal a.login-button {
    width: 100%; padding: 12px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; background: rgba(255,255,255,0.1);
    color: white; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; 
}
#login-modal h3 {
    margin-bottom: 16px;
    font-size: 2rem;
    font-weight: 600;
    color: white;
}
#login-modal p { 
    color: rgba(255, 255, 255, 0.7); 
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.5;
}
#login-modal button {
    width: 100%; padding: 12px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; background: (255,255,255,0.1);
    color: white; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}




#login-modal {
    background: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 40px; 
    width: 90%;
    max-width: 450px; 
    text-align: center;
    box-shadow: none; 
}
#github-login-btn {
    width: 100%; 
    padding: 16px 24px; 
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px; 
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white; 
    font-size: 1rem; 
    font-weight: 500;
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}



#github-login-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

#github-login-btn:active {
    transform: translateY(0);
}


#github-login-btn::before {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


.account-btn.needs-login::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    background-color: #5a78ff; 
    border-radius: 50%;
    border: 2px solid rgba(30, 30, 30, 0.8);
    

    animation: pulse 2s infinite;
}


@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(90, 120, 255, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(90, 120, 255, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(90, 120, 255, 0);
    }
}