@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#mobileMenu.show {
    transform: translateX(0);
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

.feature-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-2px);
    background-color: #f9fafc;
}

.dark .feature-card:hover {
    background-color: #1f2937;
}

.feature-card::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background-color: var(--theme-color);
    transition: width 0.3s ease;
}

.feature-card:hover::after {
    width: 100%;
}

.feature-section {
    transition: all 0.3s ease;
}

.feature-section:hover {
    box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.06);
}

.feature-block {
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.feature-block:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.popularity-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--theme-color);
    border-radius: 4px 0 0 0;
}

.dark .popularity-indicator {
    background: var(--theme-color);
}

.feature-block[data-clicks="124"] .popularity-indicator { width: 100%; }
.feature-block[data-clicks="98"] .popularity-indicator { width: 79%; }
.feature-block[data-clicks="87"] .popularity-indicator { width: 70%; }
.feature-block[data-clicks="72"] .popularity-indicator { width: 58%; }

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.sidebar-submenu.active {
    max-height: 500px;
    opacity: 1;
}

.sidebar-menu-toggle {
    cursor: pointer;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar-menu-toggle.active .toggle-icon {
    transform: rotate(90deg);
}

.theme-selector {
    position: relative;
}

#colorPickerBtn {
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    color: var(--theme-text);
}

#colorPickerBtn:hover {
    transform: scale(1.2);
}

#colorPickerBtn i {
    opacity: 0.7;
    color: inherit;
}

#colorPickerBtn:hover i {
    opacity: 1;
}

#colorPicker {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.color-panel {
    position: fixed;
    top: 72px;
    right: 12px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 100;
    width: 240px;
    display: none;
    border: 1px solid #e5e7eb;
}

.dark .color-panel {
    background-color: #1f2937;
    border-color: #374151;
}

.color-panel.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.color-panel h4 {
    margin-bottom: 12px;
    font-weight: 600;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.color-preset {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.active {
    border-color: #e5e7eb;
}

.dark .color-preset.active {
    border-color: #374151;
}

#sidebar {
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
}

header.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    width: 100%;
}

@media (min-width: 768px) {
    header.top-navbar {
        left: 16rem; 
        width: calc(100% - 16rem);
    }
    
    .flex-1.flex.flex-col {
        margin-left: 16rem; 
    }
    
    main.with-fixed-header {
        padding-top: 60px; 
    }
}

@media (max-width: 767px) {
    main.with-fixed-header {
        padding-top: 56px; 
    }
}

#mobileMenu .bg-indigo-900,
#mobileMenu .bg-white,
#mobileMenu .dark\:bg-gray-800,
#mobileMenu .dark\:bg-black {
    width: 100%;
}

.w-10.h-10.rounded-full.bg-blue-100,
.w-10.h-10.rounded-full.bg-purple-100,
.w-10.h-10.rounded-full.bg-green-100,
.w-10.h-10.rounded-full.bg-yellow-100,
.w-10.h-10.rounded-full.bg-red-100,
.w-10.h-10.rounded-full.bg-gray-100 {
    background-color: var(--theme-light);
}

.text-blue-600,
.text-green-600,
.text-purple-600,
.text-yellow-600,
.text-red-600,
.text-gray-600 {
    color: var(--theme-color);
}
.bg-theme {
    background-color: var(--theme-color);
    color: var(--theme-text);
}
.bg-theme-light {
    background-color: var(--theme-light);
    color: var(--theme-text);
}

.w-10.h-10.rounded-full i {
    color: var(--theme-color);
}

.dark .w-10.h-10.rounded-full i {
    color: var(--theme-color);
}

.w-10.h-10.rounded-full.bg-blue-100 i,
.w-10.h-10.rounded-full.bg-purple-100 i,
.w-10.h-10.rounded-full.bg-green-100 i,
.w-10.h-10.rounded-full.bg-yellow-100 i,
.w-10.h-10.rounded-full.bg-red-100 i,
.w-10.h-10.rounded-full.bg-gray-100 i {
    color: var(--theme-text);
}

.from-indigo-600, .to-blue-500, .from-indigo-500, .to-blue-600,
.from-purple-500, .to-pink-600,
.from-blue-500, .to-indigo-500 {
    --tw-gradient-from: var(--theme-color);
    --tw-gradient-to: var(--theme-hover);
}

.bg-indigo-600, .hover\:bg-indigo-700:hover, 
.bg-indigo-700, .hover\:bg-indigo-800:hover {
    background-color: var(--theme-color);
    color: var(--theme-text);
}

.bg-white.text-indigo-600, .bg-indigo-50.text-indigo-600,
.hover\:bg-indigo-50:hover.text-indigo-600 {
    color: var(--theme-color);
}

.feature-card .w-8.h-8.rounded-full,
.feature-block .w-8.h-8.rounded-full {
    background-color: transparent !important;
}

.feature-card .w-8.h-8.rounded-full i,
.feature-block .w-8.h-8.rounded-full i {
    color: inherit !important;
}

/* Theme colors */
:root {
    --theme-color: #4f46e5; 
    --theme-hover: #4338ca;
    --theme-light: #eef2ff;
    --theme-dark: #312e81;
    --theme-text: #ffffff; 
}

[data-theme="purple"] {
    --theme-color: #9333ea;
    --theme-hover: #7e22ce;
    --theme-light: #f3e8ff;
    --theme-dark: #581c87;
}

[data-theme="blue"] {
    --theme-color: #2563eb;
    --theme-hover: #1d4ed8;
    --theme-light: #eff6ff;
    --theme-dark: #1e3a8a;
}

[data-theme="green"] {
    --theme-color: #16a34a;
    --theme-hover: #15803d;
    --theme-light: #f0fdf4;
    --theme-dark: #14532d;
}

/* Apply theme colors to selected elements */
.bg-indigo-800, .bg-indigo-800:hover, .hover\:bg-indigo-800:hover {
    background-color: var(--theme-color);
    color: var(--theme-text);
}

/* Customized scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: transparent;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--theme-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--theme-hover);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-color) transparent;
}

.dark .theme-btn.active {
    box-shadow: 0 0 0 2px black, 0 0 0 4px var(--theme-color);
}

/* Dark mode transitions */
html.dark .bg-white {
    background-color: #000;
    color: #fff;
}

html.dark .text-gray-600 {
    color: #d1d5db;
}

html.dark .bg-gray-100 {
    background-color: #000;
}

.dark-mode-transition {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Active sidebar link styles */
#sidebar .bg-indigo-800, #sidebar .hover\:bg-indigo-800:hover, 
#mobileMenu .bg-indigo-800, #mobileMenu .hover\:bg-indigo-800:hover {
    background-color: var(--theme-color);
    color: var(--theme-text);
}