/*
 * Flavor Theme - Tailwind CSS Compatibility Layer
 * Bridges remaining Bootstrap classes used by JS components
 */

/* =============================================
   Logo sizing (override Tailwind img reset)
   ============================================= */
img.themeLogoImg {
    height: 36px !important;
    max-height: 36px;
    width: auto !important;
    max-width: 200px;
    padding: 0;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
@media (max-width: 767px) {
    img.themeLogoImg {
        height: 30px !important;
        max-width: 150px;
    }
}

/* =============================================
   Bootstrap Grid Compatibility (for JS-driven components)
   ============================================= */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}
.row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.col-md-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-md-2 { flex: 0 0 16.667%; max-width: 16.667%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-5 { flex: 0 0 41.667%; max-width: 41.667%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-md-8 { flex: 0 0 66.667%; max-width: 66.667%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }
.col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-md-11 { flex: 0 0 91.667%; max-width: 91.667%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }
.col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-sm-6 { flex: 0 0 50%; max-width: 50%; }
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 767px) {
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
    .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* =============================================
   Bootstrap Utility Compatibility
   ============================================= */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
.pull-left { float: left; }
.pull-right { float: right; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.align-right { text-align: right; }

/* =============================================
   Tab Compatibility (for profile page)
   ============================================= */
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.in.active,
.tab-content > .active { display: block; }
.nav-tabs { display: flex; list-style: none; padding: 0; margin: 0; }

/* =============================================
   Tool Grid - Hide/Show functionality
   ============================================= */
.hideAll { display: none; }

/* =============================================
   Form Inputs (compatibility for existing JS)
   ============================================= */
.form-input,
input.form-input,
textarea.form-input {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.form-input:focus,
input.form-input:focus,
textarea.form-input:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 1px #6366f1;
}
.width96 { width: 96% !important; }
.form-group { margin-bottom: 1rem; }

/* =============================================
   Input Group (for domain search in JS pages)
   ============================================= */
.input-group {
    display: flex;
    width: 100%;
}
.input-group .form-control,
.input-group .input-container { flex: 1; }
.input-group-btn { flex-shrink: 0; }
.input-group-btn .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    color: #9ca3af;
}

/* =============================================
   Login/Auth Form Styles
   ============================================= */
.loginpage { padding: 1rem 0; }
.login-footer { padding: 1rem 0; overflow: hidden; }
.infoshort { font-size: 1rem; color: #374151; }
.info { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.5rem; }
.bottom70 { margin-bottom: 2rem; }

/* =============================================
   Footer Links
   ============================================= */
footer ul li a,
.b-list a {
    color: #9ca3af;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}
footer ul li a:hover,
.b-list a:hover {
    color: #ffffff;
}

/* =============================================
   Navbar Link Compatibility (for headerLinks)
   ============================================= */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
nav ul > li {
    display: inline-flex;
    align-items: center;
}
nav ul > li > a {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
nav ul > li > a:hover {
    color: #111827;
    background: #f3f4f6;
}
nav ul > li.active > a {
    color: #4f46e5;
    background: #eef2ff;
}

/* Mobile menu nav list */
#mobileMenu ul > li {
    display: block;
}
#mobileMenu ul > li > a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* =============================================
   Hero Section Background
   ============================================= */
.hero-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f4f8 30%, #f5f0ff 60%, #fef3e8 100%);
    position: relative;
    overflow: visible;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(99,102,241,0.07) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

/* =============================================
   Bootstrap Modal Compatibility
   ============================================= */
.modal.fade { transition: opacity 0.15s; }
.modal .modal-dialog { position: relative; z-index: 51; }

/* =============================================
   Connect With (Social Login)
   ============================================= */
.connect-with .connect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}
.connect-with .connect:hover { opacity: 0.9; }
.connect.facebook { background: #1877f2; }
.connect.google { background: #ea4335; }
.connect.twitter { background: #1da1f2; }

/* =============================================
   Premium/Pricing Styles
   ============================================= */
.premiumTitle { font-size: 1.25rem; font-weight: 700; color: #111827; }
.premiumTable td { padding: 0.75rem; }
.canMsg { background: #fef2f2; border: 1px solid #fecaca; border-radius: 0.5rem; padding: 1rem; color: #991b1b; }
.gray16 { color: #6b7280; font-size: 1rem; }
.premiumBoxDash { padding: 1rem 0; }

/* =============================================
   Blog Compatibility
   ============================================= */
.csPageTitle { font-size: 1.5rem; font-weight: 700; color: #111827; }
.csContent { line-height: 1.75; color: #374151; }

/* =============================================
   Misc Compatibility
   ============================================= */
.top30 { margin-top: 1.5rem; }
.top40 { margin-top: 2rem; }
.top10 { margin-top: 0.5rem; }
.mr_top8 { margin-top: 0.5rem; }
.mr_top30 { margin-top: 1.5rem; }
.mr_bottom1 { margin-bottom: 0.25rem; }
.pad_left { padding-left: 0; }
.pad_left26 { padding-left: 1.5rem; }
.divider_h { border-top: 1px solid #e5e7eb; }
.color_text_in { color: #6b7280; }
.color_dark { color: #1f2937; }
.color_op { color: #374151; }
.color-grey { color: #9ca3af; }
.fz14 { font-size: 0.875rem; }
.font_14 { font-size: 0.875rem; }
.green { color: #16a34a; }
.red { color: #dc2626; }

/* Search results */
.search-results {
    position: absolute;
    z-index: 40;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}
.search-results a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
}
.search-results a:hover {
    background: #f3f4f6;
}

/* Tool search match results (from JS searchResults) */
#index-results,
#sidebar-results,
#hero-results,
#toolpage-results,
#navsticky-results,
#error404-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
#index-results:empty,
#sidebar-results:empty,
#hero-results:empty,
#toolpage-results:empty,
#navsticky-results:empty,
#error404-results:empty {
    display: none;
}
span.match {
    display: block;
}
span.match a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.1s;
}
span.match a::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat center/contain;
}
span.match a:hover {
    background: #f3f4f6;
}
span.match a strong {
    color: #111827;
    font-weight: 600;
}
span.sidebarmatch a {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}
span.sidebarmatch a::before {
    width: 0.875rem;
    height: 0.875rem;
}

/* File upload styling */
.filePickWrap {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
}
.filePickWrap:hover { border-color: #6366f1; }
.filePickWrap.active { border-color: #6366f1; background: #eef2ff; }

/* Prose content styling */
.prose { max-width: none; line-height: 1.75; }
.prose p { margin-bottom: 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose h1 { font-size: 1.5rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: 0.75rem; color: #111827; }
.prose h2 { font-size: 1.25rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; color: #111827; }
.prose h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; color: #1f2937; }
.prose h4 { font-size: 1rem; font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; color: #1f2937; }
.prose ul { list-style-type: disc; margin-bottom: 1rem; padding-left: 1.75rem; }
.prose ol { list-style-type: decimal; margin-bottom: 1rem; padding-left: 1.75rem; }
.prose li { margin-bottom: 0.375rem; padding-left: 0.25rem; }
.prose li::marker { color: #6366f1; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin-top: 0.375rem; margin-bottom: 0.375rem; }
.prose a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #4338ca; }
.prose strong { font-weight: 600; color: #111827; }
.prose img { border-radius: 0.5rem; margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose table th { padding: 0.625rem 0.75rem; border: 1px solid #e5e7eb; background: #f9fafb; font-weight: 600; text-align: left; }
.prose table td { padding: 0.625rem 0.75rem; border: 1px solid #e5e7eb; }
.prose blockquote { border-left: 4px solid #e5e7eb; padding-left: 1rem; margin: 1rem 0; color: #6b7280; font-style: italic; }
.prose br + br { display: block; content: ''; margin-top: 0.75rem; }

/* Sticky nav search transition */
#navStickySearch {
    transition: opacity 0.3s ease;
}

/* Tooltip compatibility */
.tooltip { display: none; }

/* =============================================
   Envato Marketplace sidebar card — mobile polish
   ---------------------------------------------
   The sidebar collapses below the `lg` breakpoint (1024px) and the
   marketplace card becomes full-width on phones/tablets. Below we bump
   touch targets, paddings, and font sizes so the card is comfortably
   tappable on small screens. Desktop (>=1024px) keeps the compact look
   defined by the Tailwind utility classes inline.
   ============================================= */
@media (max-width: 1023px) {
    .envato-marketplace .envato-header {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }
    .envato-marketplace .envato-header h3 {
        font-size: 0.9375rem; /* 15px */
        line-height: 1.35;
    }
    .envato-marketplace .envato-header p {
        font-size: 0.75rem; /* 12px */
        margin-top: 0.5rem;
    }
    .envato-marketplace .envato-body {
        padding: 1rem;
    }
    .envato-marketplace .envato-section-label {
        font-size: 0.6875rem; /* 11px */
        margin-bottom: 0.5rem;
    }
    .envato-marketplace .envato-grid {
        gap: 0.5rem; /* 8px from 6px */
        margin-bottom: 1rem;
    }
    .envato-marketplace .envato-grid > a {
        padding: 0.625rem 0.75rem; /* 10px 12px */
        gap: 0.625rem; /* 10px */
        min-height: 3rem; /* 48px — touch target */
    }
    .envato-marketplace .envato-grid > a > div:first-child {
        /* coloured icon square */
        width: 2rem;
        height: 2rem;
    }
    .envato-marketplace .envato-grid > a > div:first-child > i {
        font-size: 0.75rem; /* 12px */
    }
    .envato-marketplace .envato-grid > a span:first-of-type {
        /* primary label inside the link */
        font-size: 0.8125rem; /* 13px */
    }
    .envato-marketplace .envato-grid > a span:nth-of-type(2) {
        /* secondary description */
        font-size: 0.6875rem; /* 11px */
    }
    .envato-marketplace .envato-qlinks {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    .envato-marketplace .envato-qlinks > a {
        padding: 0.5rem 0.875rem; /* 8px 14px */
        font-size: 0.8125rem; /* 13px */
    }
    .envato-marketplace .envato-cta {
        padding: 0.875rem 1rem; /* 14px 16px */
        font-size: 0.8125rem; /* 13px */
    }
}
