body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #0f172a; /* A deep, dark slate for a clean look */
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

/* Interactive Glow Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        800px circle at var(--x) var(--y),
        rgba(79, 70, 229, 0.15), /* A subtle indigo glow */
        transparent 80%
    );
    z-index: -1;
    will-change: background;
}

/* Page Transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

.page-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.page-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}


/* Animated Chatbox Focus */
@keyframes draw-border-around {
  0% { background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%; }
  25% { background-size: 100% 2px, 2px 0%, 0% 2px, 2px 0%; }
  50% { background-size: 100% 2px, 2px 100%, 0% 2px, 2px 0%; }
  75% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 0%; }
  100% { background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%; }
}

#main-chat-input:focus {
    outline: none;
    box-shadow: none;
    border-color: transparent;
    background-image:
        linear-gradient(#8b5cf6, #8b5cf6),
        linear-gradient(#8b5cf6, #8b5cf6),
        linear-gradient(#8b5cf6, #8b5cf6),
        linear-gradient(#8b5cf6, #8b5cf6);
    background-repeat: no-repeat;
    background-position:
        top left,
        top right,
        bottom right,
        bottom left;
    animation: draw-border-around 1s linear forwards;
}


.profile-picture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #4f46e5;
    cursor: pointer;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #1f2937; /* gray-800 */
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.5rem;
    border: 1px solid #374151; /* gray-700 */
    margin-top: 0.5rem;
}
.dropdown-content a {
    color: #d1d5db; /* gray-300 */
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}
.dropdown-content a:hover {
    background-color: #374151; /* gray-700 */
}
.show {
    display: block;
}

/* Project List Wrapper for Scrolling */
.project-list-wrapper {
    max-height: 60vh; /* Adjust this value as needed */
    overflow-y: auto;
    padding-right: 1rem; /* Space for scrollbar */
}


/* Project Cards (List & Grid) */
.project-card { /* Used on Profile Page */
    background-color: #1f2937;
    border: 1px solid #374151;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-card:hover {
    background-color: #374151;
}

.project-grid-card { /* Used on Index Page */
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.project-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-color: #4f46e5;
}
.project-card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #374151;
}
.project-card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.project-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-card-actions .left-actions, .project-card-actions .right-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.action-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}
.action-btn:hover {
    background-color: #374151;
    color: #e5e7eb;
}
.action-btn.pinned {
    color: #facc15; /* yellow-400 */
}
.action-btn.pinned:hover {
    color: #fde047; /* yellow-300 */
}


/* Editor Chat Bubbles */
.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 90%;
    word-wrap: break-word;
}
.chat-bubble.user {
    background-color: #4f46e5;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}
.chat-bubble.assistant {
    background-color: #374151;
    color: #d1d5db;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}
.chat-bubble pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95rem;
}

/* Editor File Tree */
.file-item, .folder-item {
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.file-item:hover, .folder-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}
.file-item.selected {
    background-color: #4f46e5;
    color: white !important;
}
.file-item.selected .file-icon {
    filter: brightness(0) invert(1);
}

.file-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.folder-children {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.folder-children.collapsed {
    max-height: 0;
}


/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* Prism.js syntax highlighting theme adjustments */
pre[class*="language-"] {
    background: #1E1E1E !important;
    border-radius: 0 !important;
    margin: 0 !important;
    font-size: 0.9rem;
}

/* Token Display */
.token-display {
    position: relative;
    background-color: rgba(234, 179, 8, 0.1);
    color: #facc15;
    padding: 6px 12px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    border: 1px solid rgba(234, 179, 8, 0.2);
    text-decoration: none;
}

.token-display:hover {
    background-color: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.4);
}

/* Tooltip Base */
.token-display::before,
.token-display::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

/* Tooltip Content */
.token-display::before {
    content: attr(data-tooltip);
    top: calc(100% + 8px); /* Position below the element */
    background-color: #111827; /* gray-900 */
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid #374151; /* gray-700 */
}

/* Tooltip Arrow */
.token-display::after {
    content: '';
    top: 100%;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #111827 transparent; /* Flipped arrow */
}

/* Show on hover */
.token-display:hover::before,
.token-display:hover::after {
    opacity: 1;
}

/* Profile Page & Modal Styles */
.tab-btn, .admin-tab-btn {
    padding: 0.75rem 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af; /* gray-400 */
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.tab-btn:hover, .admin-tab-btn:hover {
    color: #e5e7eb; /* gray-200 */
}
.tab-btn.active, .admin-tab-btn.active {
    color: #6366f1; /* indigo-500 */
    border-bottom-color: #6366f1;
}

.setting-card {
    background-color: #1f2937;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #374151;
}

.achievement-card {
    background-color: #374151;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid #4f46e5;
}

.modal-input {
    background-color: #1f2937;
    border: 1px solid #4b5563;
    color: white;
    font-size: 1rem;
    border-radius: 0.5rem;
    display: block;
    width: 100%;
    padding: 0.75rem;
}
.modal-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px #4f46e5;
}
.modal-btn-primary {
    background-color: #4f46e5;
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.modal-btn-primary:hover {
    background-color: #4338ca;
}

/* Public/Private Toggle Switch */
#settings-public-toggle, #settings-for-sale-toggle {
    background-color: #374151; /* Default off color */
    transition: background-color 0.2s ease-in-out;
}
#settings-public-toggle.bg-indigo-600, #settings-for-sale-toggle.bg-indigo-600 {
    background-color: #4f46e5;
}
#settings-public-toggle span, #settings-for-sale-toggle span {
    transition: transform 0.2s ease-in-out;
}
#settings-public-toggle.bg-indigo-600 span, #settings-for-sale-toggle.bg-indigo-600 span {
    transform: translateX(1.25rem); /* 20px */
}


/* Gallery Styles */
.gallery-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #4f46e5;
}

.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
}
.filter-btn:hover {
    background-color: #374151;
    color: #e5e7eb;
}
.filter-btn.active {
    background-color: #4f46e5;
    color: white;
}

.heart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background-color: #374151;
    transition: all 0.2s;
}
.heart-btn:hover {
    color: #e5e7eb;
    background-color: #4b5563;
}
.heart-btn .heart-icon {
    transition: all 0.2s;
}
.heart-btn.hearted .heart-icon {
    color: #f43f5e; /* red-500 */
    transform: scale(1.1);
}
.heart-btn.hearted {
    color: #f43f5e;
}

/* Marketplace "Buy" Button */
.buy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(234, 179, 8, 0.1);
    color: #facc15;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: background-color 0.2s;
    border: 1px solid rgba(234, 179, 8, 0.2);
}
.buy-btn:hover {
    background-color: rgba(234, 179, 8, 0.2);
}


/* Pricing Page Styles */
.pricing-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
}
.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
}
.pricing-btn {
    width: 100%;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.faq-item {
    padding: 1.5rem;
    background-color: #1f2937;
    border-radius: 0.5rem;
    border: 1px solid #374151;
}

/* Notification Toast */
.notification-toast {
    background-color: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    border-left: 4px solid #4f46e5;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease-in-out;
}
.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Gift Card on Profile */
.gift-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-left: 4px solid #22c55e; /* green-500 */
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.claim-gift-btn {
    background-color: #22c55e;
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.claim-gift-btn:hover {
    background-color: #16a34a;
}

/* Responsive navigation */
.main-nav {
    display: none;
}
@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }
}
.mobile-nav-toggle {
    display: block;
}
@media (min-width: 768px) {
    .mobile-nav-toggle {
        display: none;
    }
}
