/**
 * Custom CSS (Non-Tailwind Styles)
 *
 * @package Momly
 * @since 1.0.0
 */

/* Add any custom CSS that cannot be achieved with Tailwind here */

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Loading animation for calculators */
.calculator-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.calculator-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ec4899;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sticky header shadow on scroll */
.site-header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Calculator result animation */
.results-section {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Progress bar animation */
#progress-bar {
    transition: width 0.8s ease-out;
}

/* Custom scrollbar for the entire page */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 6px;
}

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

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #ec4899 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effect enhancement */
.calculator-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator-card:hover {
    transform: translateY(-4px);
}

/* Disclaimer banner pulse effect */
.disclaimer-banner {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: #f59e0b;
    }
    50% {
        border-color: #fbbf24;
    }
}

/* Mobile menu slide animation */
.mobile-navigation {
    transition: max-height 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

.mobile-navigation:not(.hidden) {
    max-height: 500px;
}

/* Hero section background pattern */
.hero {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

/* Back to top button bounce effect */
#back-to-top:hover {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Form validation styles */
input.border-red-500,
select.border-red-500,
textarea.border-red-500 {
    border-color: #ef4444 !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Responsive table wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Print-friendly calculator results */
@media print {
    .calculator-form {
        display: none;
    }

    .results-section {
        border: 2px solid #000;
        padding: 20px;
        page-break-inside: avoid;
    }
}

/* List marker positioning - closer to text */
/* Override Tailwind's default list styles for tighter spacing */
ul.list-disc,
ol.list-decimal {
    padding-left: 1rem !important;
}

ul.list-disc li,
ol.list-decimal li {
    padding-left: 0.25rem !important;
}

/* Force list-inside for tighter marker positioning */
.list-disc {
    list-style-position: inside !important;
}

.list-decimal {
    list-style-position: inside !important;
}

/* Adjust for list-inside spacing */
.list-inside li {
    padding-left: 0 !important;
}

/* ========================================
   NAVIGATION MENU DROPDOWN STYLES
   ======================================== */

/* Desktop Navigation - Dropdown Submenu Styles */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation > ul {
    display: flex;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-navigation a:hover {
    color: #ec4899;
}

/* Submenu container */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    min-width: 200px;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.375rem;
    margin-top: 0;
    padding-top: 0.5rem;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    transition-delay: 0s;
}

/* Show submenu on hover with delay */
.main-navigation li:hover > ul,
.main-navigation li.focus > ul {
    visibility: visible;
    opacity: 1;
    transition-delay: 0.1s;
}

/* Keep submenu visible when hovering over the gap */
.main-navigation .menu-item-has-children {
    position: relative;
}

/* Create invisible bridge between menu item and submenu */
.main-navigation ul ul::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}

/* Submenu items */
.main-navigation ul ul li {
    width: 100%;
}

.main-navigation ul ul a {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

.main-navigation ul ul a:hover {
    background-color: #fdf2f8;
}

/* Nested submenu (third level) */
.main-navigation ul ul ul {
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 0.5rem;
    padding-top: 0;
    padding-left: 0.5rem;
}

/* Create invisible bridge for nested submenus (left side) */
.main-navigation ul ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: -0.5rem;
    width: 0.5rem;
    height: 100%;
}

/* Menu item has children indicator */
.main-navigation .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    position: relative;
    z-index: 1;
}

/* Submenu indicator (right arrow for nested items) */
.main-navigation ul ul .menu-item-has-children > a::after {
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 4px solid currentColor;
    float: right;
    margin-top: 0.25rem;
}

/* Current menu item highlighting */
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
    color: #ec4899;
    font-weight: 600;
}

/* Mobile Navigation - Accordion Style Submenus */
.mobile-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-navigation a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-navigation a:hover {
    color: #ec4899;
    background-color: #fdf2f8;
}

/* Mobile submenu container */
.mobile-navigation ul ul {
    display: none;
    padding-left: 1rem;
    background-color: #f9fafb;
}

/* Mobile submenu toggle button */
.mobile-navigation .menu-item-has-children {
    position: relative;
}

.mobile-navigation .submenu-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mobile-navigation .submenu-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.mobile-navigation .submenu-toggle.active svg {
    transform: rotate(180deg);
}

/* Show mobile submenu when toggled */
.mobile-navigation .menu-item-has-children.active > ul {
    display: block;
}

/* Mobile current menu item */
.mobile-navigation .current-menu-item > a,
.mobile-navigation .current-menu-ancestor > a {
    color: #ec4899;
    font-weight: 600;
}

/* ========================================
   FOOTER WIDGET STYLES
   ======================================== */

/* Footer widget links styling */
.footer-widget a {
    display: inline-block;
    transition: all 0.2s ease;
}

.footer-widget a:hover {
    transform: translateX(4px);
}

/* Footer widget list styling */
.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    position: relative;
    padding-left: 0;
}

/* Add subtle icon before links */
.footer-links ul li a::before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease, margin-right 0.2s ease;
}

.footer-links ul li a:hover::before {
    opacity: 1;
    margin-right: 12px;
}

/* Widget title underline effect */
.footer-widget .widget-title {
    position: relative;
    padding-bottom: 12px;
}

.footer-widget .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #3b82f6);
    border-radius: 2px;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .footer-column {
        text-align: center;
    }

    .footer-widget .widget-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links ul li a::before {
        display: none;
    }
}

/* Footer menu links */
.footer-navigation a {
    color: #9ca3af;
    transition: color 0.2s ease;
}

.footer-navigation a:hover {
    color: #f472b6;
}

/* Custom widget: Nav Menu widget in footer */
.footer-widget .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget .menu li {
    margin-bottom: 8px;
}

.footer-widget .menu a {
    color: #d1d5db;
    font-size: 0.875rem;
}

.footer-widget .menu a:hover {
    color: #f472b6;
}

/* Text widget in footer */
.footer-widget .textwidget {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #d1d5db;
}

.footer-widget .textwidget p {
    margin-bottom: 12px;
}

/* Recent posts widget in footer */
.footer-widget .widget_recent_entries ul li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #374151;
}

.footer-widget .widget_recent_entries ul li:last-child {
    border-bottom: none;
}

/* Categories widget in footer */
.footer-widget .widget_categories ul li,
.footer-widget .widget_archive ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-widget .widget_categories ul li a,
.footer-widget .widget_archive ul li a {
    flex: 1;
}

/* Search widget in footer */
.footer-widget .widget_search .search-form {
    display: flex;
    margin-top: 12px;
}

.footer-widget .widget_search input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #4b5563;
    background: #1f2937;
    color: #fff;
    border-radius: 4px 0 0 4px;
    font-size: 0.875rem;
}

.footer-widget .widget_search button[type="submit"] {
    padding: 8px 16px;
    background: #ec4899;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.footer-widget .widget_search button[type="submit"]:hover {
    background: #db2777;
}

/* Tag cloud widget in footer */
.footer-widget .tagcloud,
.footer-widget .wp-block-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.footer-widget .tagcloud a,
.footer-widget .wp-block-tag-cloud a {
    padding: 4px 12px;
    background: #374151;
    color: #d1d5db;
    border-radius: 9999px;
    font-size: 0.75rem !important;
    transition: all 0.2s ease;
}

.footer-widget .tagcloud a:hover,
.footer-widget .wp-block-tag-cloud a:hover {
    background: #ec4899;
    color: #fff;
    transform: scale(1.05);
}

/* Calendar widget in footer */
.footer-widget .widget_calendar table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.footer-widget .widget_calendar th,
.footer-widget .widget_calendar td {
    padding: 8px;
    text-align: center;
    border: 1px solid #374151;
    font-size: 0.875rem;
}

.footer-widget .widget_calendar th {
    background: #374151;
    color: #fff;
    font-weight: 600;
}

.footer-widget .widget_calendar td a {
    color: #f472b6;
    font-weight: 600;
}

/* RSS widget in footer */
.footer-widget .widget_rss ul li {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #374151;
}

.footer-widget .widget_rss .rsswidget {
    color: #fff;
    font-weight: 600;
}

.footer-widget .widget_rss .rssSummary {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #d1d5db;
}

.footer-widget .widget_rss .rss-date {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ========================================
   PAGINATION STYLES
   ======================================== */

.pagination-wrapper,
.pagination,
.navigation.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-wrapper .page-numbers,
.pagination .page-numbers,
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
    background-color: #fdf2f8;
    border-color: #ec4899;
    color: #ec4899;
}

.pagination-wrapper .page-numbers.current,
.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
    background-color: #9333ea;
    border-color: #9333ea;
    color: #ffffff;
    pointer-events: none;
}

.pagination-wrapper .page-numbers.dots,
.pagination .page-numbers.dots,
.navigation.pagination .page-numbers.dots {
    border: none;
    background: transparent;
    pointer-events: none;
}

.pagination-wrapper .prev,
.pagination-wrapper .next,
.pagination .prev,
.pagination .next,
.navigation.pagination .prev,
.navigation.pagination .next {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* WordPress default pagination structure */
.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Responsive pagination */
@media (max-width: 640px) {
    .pagination-wrapper .page-numbers,
    .pagination .page-numbers,
    .navigation.pagination .page-numbers {
        min-width: 2rem;
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}
