/* ============================================
   MICRO-INTERACTIONS FOR THE GUILD HALL
   Enhanced UI feedback and smooth animations
   ============================================ */

/* ===========================================
   BUTTON MICRO-INTERACTIONS
   =========================================== */

/* Primary Button Enhancements */
.btn-primary {
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transform: translateY(0) !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

/* Secondary Button Enhancements */
.btn-secondary {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background-clip: padding-box;
    display: inline-block !important;
    visibility: visible !important;
}

.btn-secondary:hover {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

/* Generate Button Enhancements */
.generate-btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(1px);
    transition: transform 0.1s;
}

/* Action Button Enhancements */
.action-btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

/* ===========================================
   QUEST ITEM MICRO-INTERACTIONS
   =========================================== */

.quest-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
    position: relative;
}

.quest-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1));
    transition: width 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.quest-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.6);
}

.quest-item:hover::before {
    width: 100%;
}

/* Quest Completion Animation */
.quest-item.completing {
    animation: questComplete 0.6s ease-in-out;
}

@keyframes questComplete {
    0% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(1.02); }
    75% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* ===========================================
   FORM INPUT MICRO-INTERACTIONS
   =========================================== */

.form-group input,
.form-group textarea,
.form-group select {
    transition: all 0.3s ease;
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

/* Floating Label Animation */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
    transform-origin: left top;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    transform: translateY(-20px) scale(0.8);
    color: #FFD700;
}

/* ===========================================
   NAVIGATION MICRO-INTERACTIONS
   =========================================== */

.nav-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FFD700;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.nav-item:hover {
    transform: translateY(-2px);
}

/* ===========================================
   CARD MICRO-INTERACTIONS
   =========================================== */

.card,
.stats-grid .stat-item,
.wisdom-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
}

.card:hover,
.stats-grid .stat-item:hover,
.wisdom-card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* ===========================================
   NOTIFICATION MICRO-INTERACTIONS
   =========================================== */

.notification {
    animation: slideInNotification 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: right top;
}

@keyframes slideInNotification {
    0% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.notification.removing {
    animation: slideOutNotification 0.3s ease-in forwards;
}

@keyframes slideOutNotification {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

/* ===========================================
   LOADING MICRO-INTERACTIONS
   =========================================== */

.loading-spinner {
    animation: spinPulse 1.5s ease-in-out infinite;
}

@keyframes spinPulse {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
}

/* ===========================================
   MODAL MICRO-INTERACTIONS
   =========================================== */

.modal {
    animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    transition: all 0.3s ease;
}

.modal:target .modal-content {
    animation: modalContentBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalContentBounce {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ===========================================
   XP BAR MICRO-INTERACTIONS
   =========================================== */

.xp-bar {
    position: relative;
    overflow: hidden;
}

.xp-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: xpShimmer 2s infinite;
}

@keyframes xpShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.xp-fill {
    transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: xpGlow 1.5s ease-in-out infinite alternate;
}

@keyframes xpGlow {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* ===========================================
   ICON MICRO-INTERACTIONS
   =========================================== */

.icon,
.fas,
.fab {
    transition: all 0.3s ease;
}

.icon:hover,
.btn:hover .fas,
.btn:hover .fab {
    transform: scale(1.2) rotate(5deg);
}

/* Social Media Icons */
.share-btn .fab {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.share-btn:hover .fab {
    transform: scale(1.3) rotate(360deg);
}

/* ===========================================
   LIST ITEM MICRO-INTERACTIONS
   =========================================== */

.list-item {
    transition: all 0.3s ease;
    position: relative;
}

.list-item::before {
    content: '▶';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #FFD700;
}

.list-item:hover::before {
    left: -15px;
    opacity: 1;
}

.list-item:hover {
    padding-left: 10px;
    color: #FFD700;
}

/* ===========================================
   RIPPLE EFFECT
   =========================================== */

.ripple {
    position: relative;
    overflow: hidden;
    display: inline-block !important;
    visibility: visible !important;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ===========================================
   SMOOTH SCROLLING ENHANCEMENTS
   =========================================== */

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 46, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: scale(1.1);
}

/* ===========================================
   ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
*:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* ===========================================
   UTILITY ANIMATIONS
   =========================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===========================================
   ENSURE ALL BUTTONS ARE VISIBLE
   =========================================== */

button,
.btn,
.generate-btn,
.action-btn,
input[type="submit"],
input[type="button"] {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}