* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling for all elements */
html {
    scroll-behavior: smooth;
}

/* Glassmorphism utilities */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Smooth transitions */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Text gradients */
.text-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Focus states */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Custom scrollbar for webkit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(10, 13, 20, 0.8);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(26, 28, 61, 0.9);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(36, 38, 71, 1);
}

/* Global scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 28, 61, 0.9) rgba(10, 13, 20, 0.6);
}

/* Webkit browsers global scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 13, 20, 0.6);
}

::-webkit-scrollbar-thumb {
    background: rgba(26, 28, 61, 0.9);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(36, 38, 71, 1);
}

::-webkit-scrollbar-corner {
    background: rgba(10, 13, 20, 0.6);
}

/* Scrollbar for modals and specific components */
.modal-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.modal-scrollbar::-webkit-scrollbar-track {
    background: rgba(10, 13, 20, 0.9);
}

.modal-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(26, 28, 61, 0.9);
    border-radius: 2px;
}

.modal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 48, 81, 1);
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    /* Mobile specific styles */
    .mobile-text-sm {
        font-size: 0.875rem;
    }
    
    .mobile-text-base {
        font-size: 1rem;
    }
    
    .mobile-text-lg {
        font-size: 1.125rem;
    }
    
    .mobile-text-xl {
        font-size: 1.25rem;
    }
    
    .mobile-text-2xl {
        font-size: 1.5rem;
    }
    
    .mobile-p-2 {
        padding: 0.5rem;
    }
    
    .mobile-p-4 {
        padding: 1rem;
    }
    
    .mobile-px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .mobile-py-2 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .mobile-py-4 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .mobile-mb-4 {
        margin-bottom: 1rem;
    }
    
    .mobile-mb-6 {
        margin-bottom: 1.5rem;
    }
    
    .mobile-mt-16 {
        margin-top: 4rem;
    }
    
    .mobile-mt-20 {
        margin-top: 5rem;
    }
    
    /* Touch friendly buttons */
    .mobile-touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Form improvements */
    input[type="text"],
    input[type="email"], 
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .mobile-xs-hidden {
        display: none;
    }
    
    .mobile-xs-text-sm {
        font-size: 0.875rem;
    }
    
    .mobile-xs-text-base {
        font-size: 1rem;
    }
    
    .mobile-xs-p-3 {
        padding: 0.75rem;
    }
    
    .mobile-xs-px-3 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (min-width: 641px) {
    .mobile-only {
        display: none;
    }
}

/* Improved responsive typography */
@media (max-width: 768px) {
    .responsive-text-4xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .responsive-text-3xl {
        font-size: 1.75rem;
        line-height: 1.25;
    }
    
    .responsive-text-2xl {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .responsive-text-xl {
        font-size: 1.25rem;
        line-height: 1.4;
    }
}

@media (max-width: 640px) {
    .responsive-text-4xl {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .responsive-text-3xl {
        font-size: 1.5rem;
        line-height: 1.25;
    }
    
    .responsive-text-2xl {
        font-size: 1.25rem;
        line-height: 1.3;
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .mobile-nav-stack {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mobile-nav-full {
        width: 100%;
        text-align: center;
    }
    
    .mobile-spacing-compact {
        padding: 0.5rem 1rem;
    }
}

/* Landing page specific mobile styles */
@media (max-width: 768px) {
    .landing-hero-mobile {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .landing-section-mobile {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .landing-grid-mobile {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .landing-hero-mobile {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .landing-section-mobile {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .landing-grid-mobile {
        gap: 1rem;
    }
}

/* Auth page mobile improvements */
@media (max-width: 768px) {
    .auth-container-mobile {
        padding: 1rem;
    }
    
    .auth-form-mobile {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .auth-container-mobile {
        padding: 0.5rem;
    }
    
    .auth-form-mobile {
        padding: 1rem;
    }
}

/* Better mobile scroll behavior */
@media (max-width: 768px) {
    .mobile-scroll-smooth {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .mobile-overflow-safe {
        overflow-x: hidden;
    }
}

/* Mobile menu enhancements */
.mobile-menu-transition {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu-backdrop {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Improved touch targets */
@media (max-width: 768px) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .touch-target-large {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Mobile-first flexbox utilities */
.mobile-flex-col {
    flex-direction: column;
}

@media (min-width: 640px) {
    .sm\:mobile-flex-row {
        flex-direction: row;
    }
}

@media (min-width: 768px) {
    .md\:mobile-flex-row {
        flex-direction: row;
    }
}

/* Safe area insets for mobile devices */
@supports (padding: max(0px)) {
    .safe-area-inset {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .safe-area-top {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    .safe-area-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Drag and Drop styles */
.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(1.02);
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.drag-over {
    border-color: rgba(99, 102, 241, 0.6) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    transform: translateY(-2px);
}

.drag-active .category-management-card:not(.dragging),
.drag-active .category-link-card:not(.dragging) {
    transition: all 0.3s ease;
}

.drag-active .category-management-card:not(.dragging):hover,
.drag-active .category-link-card:not(.dragging):hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Share Modal Styles */
#share-modal {
    animation: fadeIn 0.3s ease-out;
}

#share-modal .bg-gray-900\/95 {
    animation: slideUp 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Share button hover effects */
#share-modal button:hover {
    transform: translateY(-1px);
}

#share-modal button:active {
    transform: translateY(0);
}

/* Social media button specific hover effects */
#share-modal button[onclick*="Facebook"]:hover {
    box-shadow: 0 4px 15px rgba(59, 89, 152, 0.4);
}

#share-modal button[onclick*="Twitter"]:hover {
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
}

#share-modal button[onclick*="LinkedIn"]:hover {
    box-shadow: 0 4px 15px rgba(0, 119, 181, 0.4);
}

#share-modal button[onclick*="Discord"]:hover {
    box-shadow: 0 4px 15px rgba(114, 137, 218, 0.4);
}

#share-modal button[onclick*="Instagram"]:hover {
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.4);
}

/* Email input focus effect */
#share-email:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Copy link button pulse effect */
#share-modal button[onclick*="copyShareLink"] {
    position: relative;
    overflow: hidden;
}

#share-modal button[onclick*="copyShareLink"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#share-modal button[onclick*="copyShareLink"]:active::after {
    width: 300px;
    height: 300px;
}

.imgcol {
    text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000
}

/* Tooltip styles */
.tooltip-trigger {
    position: relative;
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
    pointer-events: none;
}

.tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    bottom: 94%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
    pointer-events: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}