/* Additional custom styles (Tailwind handles most styling) */

/* FORCE orange background on Post Request button - override everything */
.post-request-btn,
a[href="create-post.html"] {
    background-color: #f97316 !important;
    color: white !important;
}

.post-request-btn:hover,
a[href="create-post.html"]:hover {
    background-color: #ea580c !important;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth transitions - exclude transform for slide menu */
/* Removed global transition - was causing conflicts with Tailwind classes */
/* * {
    transition: all 0.2s ease;
} */

/* Mobile menu slide-in (override default transition for transform) */
#mobile-menu {
    transition: transform 0.3s ease-in-out !important;
}

#menu-overlay {
    transition: opacity 0.3s ease !important;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Slower spinner for button loading states */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin-animation {
    display: inline-block;
    animation: spin-slow 1s linear infinite;
}

/* Slide in animation for notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Success/Error notification styles */
.success-notification {
    background-color: #10B981 !important;
}

.error-notification {
    background-color: #EF4444 !important;
}

/* Notification animation override */
.success-notification,
.error-notification {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* ============================================
   RESPONSIVE HEADER STYLES
   ============================================ */

/* Medium screens (501px-768px): Adjust spacing */
@media (min-width: 501px) and (max-width: 768px) {
    /* Ensure proper alignment on tablet-sized devices */
    #user-menu {
        gap: 0.75rem !important;
    }

    #user-name {
        font-size: 0.9375rem;
    }
}

/* At 500px and below: Hide logout button and optimize layout */
@media (max-width: 500px) {
    /* Hide logout button - it's available in mobile menu */
    #logout-btn {
        display: none !important;
    }

    /* Hide username - it's available in mobile menu */
    #user-name {
        display: none !important;
    }

    /* Hide user avatar icon - it's available in mobile menu */
    #user-avatar {
        display: none !important;
    }

    /* Hide site name on very small screens */
    header .flex.items-center.gap-3 span {
        display: none !important;
    }

    /* Compact Post Request button */
    #user-menu a[href*="create-post"] {
        font-size: 0.875rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Tighter spacing for mobile */
    #user-menu {
        gap: 0.5rem !important;
    }

    /* Ensure header content doesn't overflow */
    header .max-w-7xl > div {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Very small screens (375px and below - iPhone SE, etc.) */
@media (max-width: 375px) {
    /* Further reduce Post Request button text */
    #user-menu a[href*="create-post"] {
        font-size: 0.75rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Tighter spacing */
    #user-menu {
        gap: 0.375rem !important;
    }

    /* Smaller header padding */
    header .max-w-7xl > div {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ============================================
   MOBILE LOGO STYLES
   ============================================ */

/* Mobile devices (below 640px): Smaller logos */
@media (max-width: 639px) {
    /* Header logo - smaller on mobile */
    header img[alt="Get Quick Help Logo"] {
        height: 0.875rem !important; /* 14px - slightly smaller */
        width: auto;
    }

    /* Header max-w-7xl container - 10px left padding, 10px right padding */
    header .max-w-7xl {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Header logo container - no extra padding */
    header .flex.items-center.gap-3.flex-shrink-0 {
        padding-left: 0 !important;
    }

    /* Right side buttons container - equal spacing */
    header .flex.items-center.gap-4 {
        gap: 0.5rem !important; /* Equal spacing between all right-side elements */
    }

    /* Auth buttons - equal spacing */
    #auth-buttons {
        gap: 0.5rem !important;
    }

    /* Reduce padding on Login and Sign Up buttons */
    #auth-buttons a {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.875rem !important;
    }

    /* Footer logo - smaller on mobile */
    footer img[alt="Get Quick Help Logo"] {
        height: 1rem !important; /* 16px */
        width: auto;
    }
}

/* Extra small devices (below 375px): Even smaller logos */
@media (max-width: 375px) {
    /* Header logo - extra small */
    header img[alt="Get Quick Help Logo"] {
        height: 0.75rem !important; /* 12px */
        width: auto;
    }

    /* Footer logo - extra small */
    footer img[alt="Get Quick Help Logo"] {
        height: 0.875rem !important; /* 14px */
        width: auto;
    }
}

/* ============================================
   BLOG POST SHARE BUTTONS - MOBILE FIX
   ============================================ */

/* Mobile devices: Make share buttons wrap and reduce size */
@media (max-width: 639px) {
    /* Share buttons container - allow wrapping */
    article .flex.gap-3 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    /* Share buttons - reduce padding and font size */
    article .flex.gap-3 > a,
    article .flex.gap-3 > button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem;
        white-space: nowrap;
    }
}

/* Extra small devices: Even more compact buttons */
@media (max-width: 375px) {
    article .flex.gap-3 > a,
    article .flex.gap-3 > button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8125rem;
        gap: 0.25rem;
    }
}

/* ============================================
   BLOG SIDEBAR - RESPONSIVE DESIGN
   ============================================ */

/* Mobile devices: Stack sidebar below content */
@media (max-width: 1023px) {
    /* Sidebar appears below content on mobile/tablet */
    article aside {
        order: 2;
        margin-top: 2rem;
    }

    /* Remove sticky positioning on mobile */
    article aside .sticky {
        position: relative !important;
        top: auto !important;
    }
}

/* Desktop: Sidebar is sticky */
@media (min-width: 1024px) {
    /* Sidebar sticks to top when scrolling */
    article aside > div:first-child {
        position: sticky;
        top: 6rem;
    }
}

/* ============================================
   CONTACT INFO MASKING STYLES
   ============================================ */

/* Masked contact info in text */
.contact-masked {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: help;
    white-space: nowrap;
}

.contact-masked:hover {
    background: linear-gradient(135deg, #2563eb, #0891b2);
}
