/* Fancy Font Generator Frontend Styles - Exact Match to Images */

/* Accessibility Improvements */
.ffg-generator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: white;
    position: relative;
    /* Ensure proper focus management */
    outline: none;
    /* Allow Elementor to override width */
    box-sizing: border-box;
}

.ffg-generator-container:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ffg-font-item {
        border: 2px solid;
    }
    
    .ffg-copy-btn {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ffg-font-item,
    .ffg-copy-btn,
    .ffg-animation {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus indicators */
.ffg-copy-btn:focus,
.ffg-font-item:focus,
.ffg-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Skip links */
.ffg-skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
}

.ffg-skip-link:focus {
    top: 6px;
}

/* ARIA live regions */
.ffg-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Button accessibility */
.ffg-copy-btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form accessibility */
.ffg-input {
    min-height: 44px;
    padding: 12px;
}

/* Loading states with accessibility */
.ffg-loading {
    position: relative;
}

.ffg-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error states */
.ffg-error {
    border-left: 4px solid #dc3232;
    background: #fef7f7;
    padding: 12px;
    margin: 10px 0;
}

.ffg-error[role="alert"] {
    color: #dc3232;
}

/* Success states */
.ffg-success {
    border-left: 4px solid #46b450;
    background: #f7fcf7;
    padding: 12px;
    margin: 10px 0;
}

/* Keyboard navigation */
.ffg-font-item[tabindex="0"]:focus {
    box-shadow: 0 0 0 2px #0073aa;
}

/* Touch targets */
@media (max-width: 768px) {
    .ffg-copy-btn,
    .ffg-font-item,
    .ffg-input {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Sticky Header Area */
.ffg-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    color: #333;
    padding: 1rem 0 2rem;
    margin-bottom: 0;
}

.ffg-header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1.5rem;
    position: relative;
}

.ffg-header-content::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 1.5rem;
    right: 1.5rem;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
}
/* Softer divider color in dark theme */
.ffg-generator-container.dark-theme .ffg-header-content::after {
    background: rgba(255, 255, 255, 0.12);
}

/* Remove white strip behind the main input in dark theme */
.ffg-generator-container.dark-theme .ffg-input-section {
    background: transparent !important;
}

.ffg-page-title {
    display: none;
}

.ffg-tagline {
    display: none;
}

/* In Elementor, show title and description so typography controls affect visible elements */
.elementor-widget .ffg-page-title,
.elementor-widget .ffg-tagline {
    display: block;
}

/* Main Text Input with Inline Controls */
.ffg-input-section {
    margin-bottom: 0;
}

.ffg-input-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.ffg-text-input {
    width: 100% !important;
    max-width: 1200px !important;
    padding: 0.6rem 1rem 0.6rem 1rem !important; /* further reduced padding */
    border: none !important;
    border-radius: 9999px !important;
    font-size: 1.1rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background: #ffffff;
    color: #1a202c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    min-height: 42px !important; /* further reduced height */
    backdrop-filter: blur(10px) !important;
}

/* Remove decorative emoji icon from input */
.ffg-text-input::before { content: none !important; }

.ffg-text-input:focus::before { content: none !important; }


.ffg-text-input:hover {
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(0);
}

.ffg-text-input:focus {
    outline: none;
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(0);
}

.ffg-text-input::placeholder {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.025em;
}

.ffg-text-input:focus::placeholder {
    color: #d1d5db;
    transform: translateX(5px);
}



/* Categories Container */
.ffg-categories-container {
    padding: 2rem 1.5rem;
}

/* No Fonts Message */
.ffg-no-fonts {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 2rem 0;
}

.ffg-no-fonts p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}


/* Error Messages */
.ffg-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    text-align: center;
}

/* Category Cards */
.ffg-category-card {
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ffg-category-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(0);
}

.ffg-category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
}

/* Font Style Rows */
.ffg-styles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ffg-style-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    padding: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    gap: 8px;
    position: relative;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 60px;
    width: 100%;
}


.ffg-style-row:hover {
    background: #f8f9fa;
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-left-color: #764ba2;
}

.ffg-style-label-top {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #667eea;
    padding: 0 8px;
    z-index: 1;
    line-height: 1;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ffg-style-label-top:hover {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.ffg-style-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-align: left;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
    display: block;
    height: 20px;
    display: flex;
    align-items: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.ffg-style-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    flex: 1;
    text-align: center;
    padding: 1rem;
    position: relative;
}

.ffg-preview-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    word-break: break-word;
    max-width: calc(100% - 180px) !important; /* Increased margin to prevent overflow behind icons - Desktop only */
    display: block !important; /* Change from flex to block for better text handling */
    align-items: center;
    justify-content: center;
    width: calc(100% - 180px) !important; /* Increased margin for action buttons */
    line-height: 1.4;
    min-height: 1.4em;
    background: transparent;
    border-radius: 4px;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem !important; /* Remove right padding */
    margin: 0 180px 0 0 !important; /* Increased right margin to prevent overlap */
    box-sizing: border-box;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    /* Fix text scattering and special characters */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: pre-wrap !important;
    /* Handle special characters and emojis properly */
    unicode-bidi: normal !important;
    direction: ltr !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.ffg-style-row:hover .ffg-preview-text {
    text-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: scale(1);
}

.ffg-style-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 4px 8px;
    box-sizing: border-box;
    margin: 0;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    /* Ensure buttons don't overlap on smaller screens */
    flex-wrap: wrap !important;
    max-width: 120px !important;
}

.ffg-copy-btn,
.ffg-share-btn,
.ffg-download-btn,
.ffg-like-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    border-radius: 8px;
    padding: 8px !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    backdrop-filter: blur(10px);
}


.ffg-copy-btn:hover,
.ffg-share-btn:hover,
.ffg-download-btn:hover,
.ffg-like-btn:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    color: #5a67d8;
    border-color: rgba(102, 126, 234, 0.4) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25) !important;
}

.ffg-copy-btn:active,
.ffg-share-btn:active,
.ffg-download-btn:active,
.ffg-like-btn:active {
    transform: scale(1);
}

.ffg-copy-btn.ffg-copied {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.ffg-copy-btn.ffg-copying {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
    cursor: not-allowed;
}

.ffg-copy-btn.ffg-copy-error {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

/* Like button states */
.ffg-like-btn.ffg-liked {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.ffg-like-btn.ffg-liked .ffg-like-icon {
    fill: #ec4899 !important;
    stroke: #ec4899 !important;
}


/* Dark theme like button states */
.ffg-generator-container.dark-theme .ffg-like-btn.ffg-liked {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.ffg-generator-container.dark-theme .ffg-like-btn.ffg-liked .ffg-like-icon {
    fill: #ec4899 !important;
    stroke: #ec4899 !important;
}

.ffg-generator-container.dark-theme .ffg-like-btn.ffg-liked:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Ensure liked state overrides all other styles */
.ffg-like-btn.ffg-liked {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.ffg-like-btn.ffg-liked .ffg-like-icon {
    fill: #ec4899 !important;
    stroke: #ec4899 !important;
}

.ffg-generator-container.dark-theme .ffg-like-btn.ffg-liked {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.ffg-generator-container.dark-theme .ffg-like-btn.ffg-liked .ffg-like-icon {
    fill: #ec4899 !important;
    stroke: #ec4899 !important;
}

/* Ensure all action buttons are always visible and consistently sized */
.ffg-copy-btn,
.ffg-share-btn,
.ffg-download-btn,
.ffg-like-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Universal button sizing - override any conflicting rules */
.ffg-style-actions .ffg-copy-btn,
.ffg-style-actions .ffg-share-btn,
.ffg-style-actions .ffg-download-btn,
.ffg-style-actions .ffg-like-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 6px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    position: relative !important;
    vertical-align: middle !important;
}

/* Force all four buttons to be perfectly aligned */
.ffg-style-actions .ffg-copy-btn,
.ffg-style-actions .ffg-share-btn,
.ffg-style-actions .ffg-download-btn,
.ffg-style-actions .ffg-like-btn {
    align-self: center !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

/* Force flex layout to work properly */
.ffg-style-preview {
    width: 100% !important;
    position: relative !important;
}

/* Dark theme button sizing consistency */
.ffg-generator-container.dark-theme .ffg-style-actions .ffg-copy-btn,
.ffg-generator-container.dark-theme .ffg-style-actions .ffg-share-btn,
.ffg-generator-container.dark-theme .ffg-style-actions .ffg-download-btn,
.ffg-generator-container.dark-theme .ffg-style-actions .ffg-like-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 6px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.ffg-clipboard-icon,
.ffg-share-icon,
.ffg-download-icon,
.ffg-like-icon {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    display: block !important;
    margin: 0 auto !important;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ffg-copy-btn:hover .ffg-clipboard-icon,
.ffg-share-btn:hover .ffg-share-icon,
.ffg-download-btn:hover .ffg-download-icon,
.ffg-like-btn:hover .ffg-like-icon {
    transform: scale(1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ===== DESKTOP DESIGN FOR ALL DEVICES ===== */

/* Keep the same desktop design across all screen sizes */
.ffg-generator-container {
    padding: 2rem;
    max-width: 1200px;
}

/* ========================================
   ELEMENTOR FULL-WIDTH FIXES
   ======================================== */

/* Force full width in Elementor - highest priority */
.elementor-widget-fancy-font-generator .ffg-generator-container,
.elementor-widget .ffg-generator-container,
.elementor-column .ffg-generator-container,
.elementor-section .ffg-generator-container,
.e-con .ffg-generator-container,
.e-con-inner .ffg-generator-container {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.elementor-widget-fancy-font-generator .ffg-header-content,
.elementor-widget-fancy-font-generator .ffg-text-input,
.elementor-widget-fancy-font-generator .ffg-categories-container,
.elementor-widget .ffg-header-content,
.elementor-widget .ffg-text-input,
.elementor-widget .ffg-categories-container {
    max-width: 100% !important;
    width: 100% !important;
}

/* Ensure Elementor column wrapper doesn't constrain width */
.elementor-column .elementor-widget .ffg-generator-container,
.elementor-section .elementor-widget .ffg-generator-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override any Elementor wrapper constraints */
.elementor-widget-container .ffg-generator-container,
.elementor-widget-container .ffg-universal-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Remove any padding/margin from Elementor widget wrapper */
.elementor-widget-fancy-font-generator,
.elementor-widget-fancy-font-generator .elementor-widget-container,
.ffg-elementor-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ffg-elementor-wrapper .ffg-generator-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Override Elementor column padding that might constrain width */
.elementor-column:has(.ffg-elementor-wrapper),
.elementor-column:has(.ffg-generator-container) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Override Elementor Flexbox Container (.e-con) max-width constraint */
.e-con:has(.ffg-elementor-wrapper) .e-con-inner,
.e-con:has(.ffg-generator-container) .e-con-inner,
.e-con .e-con-inner:has(.ffg-elementor-wrapper),
.e-con .e-con-inner:has(.ffg-generator-container) {
    max-width: 100% !important;
    width: 100% !important;
}

/* Fallback for browsers without :has() support */
.elementor-column .ffg-elementor-wrapper {
    margin-left: calc(-1 * var(--elementor-column-padding-left, 0)) !important;
    margin-right: calc(-1 * var(--elementor-column-padding-right, 0)) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Fallback for Elementor Flexbox Container without :has() support */
.e-con .ffg-elementor-wrapper,
.e-con .ffg-generator-container {
    width: 100% !important;
    max-width: 100% !important;
}

.e-con .e-con-inner {
    --content-width: 100% !important;
}

.ffg-sticky-header {
    padding: 1.5rem 0 2rem;
}

.ffg-header-content {
    padding: 0 1.5rem;
}

.ffg-header-content::after {
    left: 1.5rem;
    right: 1.5rem;
}

.ffg-text-input {
    width: 100% !important;
    max-width: 1200px !important;
    padding: 1.25rem 1.25rem 1.25rem 1.25rem !important;
    min-height: 60px !important;
    font-size: 1.15rem !important;
    border-radius: 9999px !important;
}

.ffg-text-input::before {
    left: 1.75rem;
    font-size: 1.4rem;
}

.ffg-input-controls {
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.ffg-categories-container {
    padding: 2rem 1.5rem;
}

.ffg-category-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ffg-category-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.ffg-style-row {
    grid-template-columns: 1fr 200px !important;
    grid-template-areas: "preview actions" !important;
    gap: 8px;
    padding: 0;
    text-align: left;
}

.ffg-style-label-top {
    position: absolute;
    top: -10px;
    left: 12px;
    grid-column: 1;
}

.ffg-style-preview {
    order: unset;
    margin-bottom: 0;
    grid-column: 1;
    min-height: 60px;
}

    .ffg-style-actions {
        grid-column: 2;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: row !important;
        height: 60px !important;
        min-height: 60px !important;
        gap: 6px !important;
    }

.ffg-copy-btn,
.ffg-share-btn,
.ffg-download-btn,
.ffg-like-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.ffg-categories-navigation {
    padding: 2rem 1.5rem;
}

.ffg-category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.ffg-category-page-header {
    padding: 3rem 1.5rem;
}

.ffg-category-page-header h1 {
    font-size: 2.5rem;
}

.ffg-category-page-header p {
    font-size: 1.2rem;
}

/* Ensure desktop layout works on all devices */
@media (max-width: 767px) {
    .ffg-generator-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .ffg-text-input {
        padding: 0.5rem 0.8rem !important; /* further reduced padding on tablet */
        min-height: 38px !important;
        font-size: 16px !important;
    }
    
    .ffg-text-input::before {
        left: 1.25rem;
        font-size: 1.2rem;
    }
    
    /* Fix placeholder text for tablet */
    .ffg-text-input::placeholder {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }
    
    .ffg-categories-container {
        padding: 1rem 0.5rem;
    }
    
    .ffg-category-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .ffg-category-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .ffg-style-row {
        grid-template-columns: 1fr 200px !important;
    grid-template-areas: "preview actions" !important;
        gap: 8px;
        padding: 0;
        text-align: left;
    }
    
    .ffg-style-label-top {
        position: absolute;
        top: -10px;
        left: 12px;
        grid-column: 1;
    }
    
    .ffg-style-preview {
        order: unset;
        margin-bottom: 0;
        grid-column: 1;
        min-height: 60px;
    }
    
    .ffg-style-actions {
        grid-column: 2;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: row !important;
        height: 60px !important;
        min-height: 60px !important;
        gap: 6px !important;
    }
    
    .ffg-copy-btn,
    .ffg-share-btn,
    .ffg-download-btn,
    .ffg-like-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        padding: 8px !important;
    }
    
    .ffg-categories-navigation {
        padding: 1rem 0.5rem;
    }
    
    .ffg-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .ffg-category-page-header {
        padding: 2rem 1rem;
    }
    
    .ffg-category-page-header h1 {
        font-size: 2rem;
    }
    
    .ffg-category-page-header p {
        font-size: 1rem;
    }
}

/* Mobile-specific fixes for input text preview and copy icon */
/* Tablet responsive design */
@media (max-width: 768px) and (min-width: 576px) {
    .ffg-generator-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    /* Tablet action buttons */
    .ffg-style-actions {
        padding: 6px 8px !important;
        margin: 0 !important;
        gap: 4px !important;
        height: auto !important;
        min-height: 50px !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        max-width: 120px !important;
        right: 6px !important;
    }
    
    .ffg-style-actions .ffg-copy-btn,
    .ffg-style-actions .ffg-share-btn,
    .ffg-style-actions .ffg-download-btn,
    .ffg-style-actions .ffg-like-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        padding: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    
    /* Tablet preview text */
    .ffg-preview-text {
        max-width: calc(100% - 130px) !important;
        width: calc(100% - 130px) !important;
        margin: 0 130px 0 0 !important;
    }
}

@media (max-width: 575px) {
    .ffg-generator-container {
        padding: 0.75rem;
    }
    
    .ffg-text-input {
        padding: 0.5rem 0.8rem !important; /* further reduced padding on mobile */
        min-height: 36px !important;
        font-size: 16px !important;
        /* Fix input text preview for mobile */
        line-height: 1.4 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .ffg-text-input::before {
        left: 1rem;
        font-size: 1.1rem;
    }
    
    /* Fix placeholder text for mobile */
    .ffg-text-input::placeholder {
        font-size: 14px !important;
        line-height: 1.3 !important;
        color: #9ca3af !important;
        font-style: italic !important;
        font-weight: 400 !important;
    }
    
    .ffg-categories-container {
        padding: 0.75rem 0.25rem;
    }
    
    .ffg-category-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .ffg-category-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile: Keep buttons inside field but with proper spacing */
    .ffg-style-row {
        display: grid !important;
        grid-template-columns: 1fr 120px !important; /* Reduced width for action buttons */
    grid-template-areas: "preview actions" !important;
        gap: 8px !important;
        padding: 0 !important;
        margin-top: 8px !important;
        width: 100% !important;
    }
    
    /* Ensure preview area takes remaining width */
    .ffg-style-preview {
        grid-area: preview !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.75rem !important;
        position: relative !important;
    }
    
    /* Keep actions inside field but with proper spacing */
    .ffg-style-actions {
        grid-area: actions !important;
        width: 100% !important;
        position: absolute !important;
        right: 12px !important; /* Reduced spacing from right border */
        bottom: 8px !important; /* Position from bottom with clearance */
        top: auto !important;
        transform: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 16px 0 !important; /* Maximum padding for bottom spacing */
        margin: 0 !important;
        gap: 4px !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: 80px !important; /* Maximum height for counters */
    }
    
    .ffg-style-label-top {
        top: -8px;
        left: 10px;
        padding: 0 6px;
    }
    
    .ffg-style-name {
        font-size: 0.7rem;
        height: 18px;
    }
    
    .ffg-style-preview {
        min-height: 100px !important; /* Further increased height for mobile */
        padding: 0.75rem;
        position: relative !important;
    }
    
    .ffg-preview-text {
        font-size: 0.85rem !important; /* Smaller font size for mobile */
        line-height: 1.2 !important; /* Tighter line height */
        min-height: 1.2em !important;
        padding: 0.5rem !important; /* Increased padding for better text visibility */
        /* Ensure text is fully visible on mobile */
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: calc(100% - 140px) !important; /* Reduced space for action buttons */
        width: calc(100% - 140px) !important;
        margin: 0 !important;
        display: block !important; /* Change from flex to block for better text wrapping */
        text-align: left !important; /* Left align for better readability */
        box-sizing: border-box !important; /* Include padding in width calculation */
        overflow: visible !important; /* Allow text to be fully visible */
        white-space: pre-wrap !important; /* Preserve line breaks and wrap text */
    }
    
    /* Mobile: Action buttons below the field */
    .ffg-style-actions {
        position: static !important; /* Normal document flow */
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        right: auto !important;
        top: auto !important;
        padding: 8px 0 !important;
        margin: 0 !important; /* No margin needed - grid handles spacing */
        gap: 8px !important;
        height: auto !important;
        min-height: auto !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        max-width: none !important;
        background: transparent !important; /* No background needed */
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        display: flex !important; /* Ensure it's displayed as flex */
        grid-area: actions !important; /* Grid positioning */
        width: 100% !important;
        justify-self: center !important;
    }
    
    .ffg-style-actions .ffg-copy-btn,
    .ffg-style-actions .ffg-share-btn,
    .ffg-style-actions .ffg-download-btn,
    .ffg-style-actions .ffg-like-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        padding: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        border-radius: 4px !important; /* Smaller rounded corners */
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        transition: all 0.2s ease !important;
        margin-bottom: 10px !important;
    }
    
    .ffg-style-actions .ffg-copy-btn:hover,
    .ffg-style-actions .ffg-share-btn:hover,
    .ffg-style-actions .ffg-download-btn:hover,
    .ffg-style-actions .ffg-like-btn:hover {
        background: #667eea !important;
        color: white !important;
        transform: scale(1.05) !important;
    }
    
    .ffg-clipboard-icon,
    .ffg-share-icon,
    .ffg-download-icon,
    .ffg-like-icon {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Mobile: Smaller font sizes for action labels and counters */
    .ffg-action-label {
        font-size: 0.6rem !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        margin-bottom: 2px !important;
    }
    
    .ffg-action-count {
        font-size: 0.5rem !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        margin-top: 2px !important;
        margin-bottom: 8px !important; /* Maximum bottom margin to prevent touching border */
    }
    
    .ffg-categories-navigation {
        padding: 0.75rem 0.25rem;
    }
    
    .ffg-category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ffg-category-page-header {
        padding: 1.5rem 0.75rem;
    }
    
    .ffg-category-page-header h1 {
        font-size: 1.75rem;
    }
    
    .ffg-category-page-header p {
        font-size: 0.9rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 375px) {
    .ffg-generator-container {
        padding: 0.5rem;
    }
    
    .ffg-text-input {
        padding: 0.4rem 0.6rem !important; /* further reduced padding on small mobile */
        min-height: 32px !important;
        font-size: 15px !important;
    }
    
    .ffg-text-input::before {
        left: 0.875rem;
        font-size: 1rem;
    }
    
    /* Fix placeholder text for very small mobile */
    .ffg-text-input::placeholder {
        font-size: 13px !important;
        line-height: 1.2 !important;
        color: #9ca3af !important;
        font-style: italic !important;
        font-weight: 400 !important;
    }
    
    .ffg-categories-container {
        padding: 0.5rem 0.125rem;
    }
    
    .ffg-category-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .ffg-style-row {
        grid-template-columns: 1fr 200px !important;
    grid-template-areas: "preview actions" !important;
        gap: 4px;
        margin-top: 6px;
    }
    
    .ffg-style-label-top {
        top: -6px;
        left: 8px;
        padding: 0 4px;
    }
    
    .ffg-style-name {
        font-size: 0.65rem;
        height: 16px;
    }
    
    .ffg-style-preview {
        min-height: 90px !important; /* Further increased height for small mobile */
        padding: 0.5rem;
        position: relative !important;
        grid-area: preview !important;
        width: 100% !important;
    }
    
    /* Small Mobile: Keep buttons inside field but with proper spacing */
    .ffg-style-row {
        display: grid !important;
        grid-template-columns: 1fr 100px !important; /* Smaller width for action buttons */
        grid-template-areas: "preview actions" !important;
        gap: 6px !important;
        padding: 0 !important;
        margin-top: 6px !important;
        width: 100% !important;
    }
    
    /* Keep actions inside field but with proper spacing */
    .ffg-style-actions {
        grid-area: actions !important;
        width: 100% !important;
        position: absolute !important;
        right: 10px !important; /* Reduced spacing from right border */
        bottom: 6px !important; /* Position from bottom with clearance */
        top: auto !important;
        transform: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 16px 0 !important; /* Increased padding for bottom spacing */
        margin: 0 !important;
        gap: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: 70px !important; /* Maximum height for counters */
    }
    
    .ffg-preview-text {
        font-size: 0.75rem !important; /* Even smaller for very small screens */
        line-height: 1.1 !important; /* Very tight line height */
        min-height: 1.1em !important;
        padding: 0.4rem !important; /* Increased padding for better text visibility */
        /* Ensure text is fully visible on very small mobile */
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: calc(100% - 120px) !important; /* Reduced space for action buttons */
        width: calc(100% - 120px) !important;
        margin: 0 !important;
        display: block !important;
        text-align: left !important;
        box-sizing: border-box !important; /* Include padding in width calculation */
        overflow: visible !important; /* Allow text to be fully visible */
        white-space: pre-wrap !important; /* Preserve line breaks and wrap text */
    }
    
    /* Mobile: Move action buttons completely outside the field */
    .ffg-style-actions {
        position: static !important; /* Normal document flow */
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        right: auto !important;
        top: auto !important;
        padding: 8px 0 !important;
        margin: 6px 0 0 0 !important; /* Space above the buttons */
        gap: 0 !important;
        height: auto !important;
        min-height: auto !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        max-width: none !important;
        background: transparent !important; /* No background needed */
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    
    .ffg-style-actions .ffg-copy-btn,
    .ffg-style-actions .ffg-share-btn,
    .ffg-style-actions .ffg-download-btn,
    .ffg-style-actions .ffg-like-btn {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
        padding: 3px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        border-radius: 4px !important; /* Smaller rounded corners */
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        transition: all 0.2s ease !important;
    }
    
    .ffg-style-actions .ffg-copy-btn:hover,
    .ffg-style-actions .ffg-share-btn:hover,
    .ffg-style-actions .ffg-download-btn:hover,
    .ffg-style-actions .ffg-like-btn:hover {
        background: #667eea !important;
        color: white !important;
        transform: scale(1.05) !important;
    }
    
    .ffg-clipboard-icon,
    .ffg-share-icon,
    .ffg-download-icon,
    .ffg-like-icon {
        width: 12px !important;
        height: 12px !important;
    }
    
    /* Small Mobile: Even smaller font sizes for action labels and counters */
    .ffg-action-label {
        font-size: 0.5rem !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        margin-bottom: 1px !important;
    }
    
    .ffg-action-count {
        font-size: 0.4rem !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        margin-top: 1px !important;
        margin-bottom: 6px !important; /* Maximum bottom margin to prevent touching border */
    }
}

/* Extra extra small mobile devices */
@media (max-width: 320px) {
    .ffg-text-input {
        padding: 0.35rem 0.5rem !important; /* further reduced padding on very small devices */
        min-height: 28px !important;
        font-size: 14px !important;
    }
    
    .ffg-text-input::before {
        left: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Fix placeholder text for extra small mobile */
    .ffg-text-input::placeholder {
        font-size: 12px !important;
        line-height: 1.1 !important;
        color: #9ca3af !important;
        font-style: italic !important;
        font-weight: 400 !important;
    }
    
    .ffg-preview-text {
        font-size: 0.7rem !important; /* Smallest font size for very small screens */
        line-height: 1.1 !important;
        min-height: 1.1em !important;
        padding: 0.1rem !important;
        /* Maximum text visibility on very small screens */
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: calc(100% - 100px) !important; /* Increased margin for smallest action buttons */
        width: calc(100% - 100px) !important;
        margin: 0 100px 0 0 !important;
        display: block !important;
        text-align: left !important;
    }
    
    .ffg-style-preview {
        min-height: 40px !important;
        padding: 0.4rem;
    }
    
    .ffg-style-row {
        grid-template-columns: 1fr 200px !important;
    grid-template-areas: "preview actions" !important;
        gap: 3px;
        margin-top: 5px;
    }
    
    .ffg-copy-btn,
    .ffg-share-btn,
    .ffg-download-btn,
    .ffg-like-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        padding: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    
    .ffg-clipboard-icon,
    .ffg-share-icon,
    .ffg-download-icon,
    .ffg-like-icon {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Animation for copy feedback */


/* Custom scrollbar */
.ffg-categories-container::-webkit-scrollbar {
    width: 8px;
}

.ffg-categories-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ffg-categories-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ffg-categories-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Infinite Scroll Styles */
.ffg-infinite-loader {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.ffg-infinite-loader .ffg-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin-bottom: 15px;
}

.ffg-load-more-btn {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
}

.ffg-load-more-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ffg-load-more-button:hover {
    background: #764ba2;
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ffg-load-more-button:active {
    transform: translateY(0);
}

.ffg-end-of-content {
    text-align: center;
    padding: 40px 20px;
    background: #f0f9eb;
    border: 1px solid #d0e9c6;
    border-radius: 8px;
    margin: 20px 0;
    color: #3c763d;
}

.ffg-end-of-content p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}


/* Category Navigation Styles */
.ffg-categories-navigation {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.ffg-nav-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ffg-nav-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.ffg-nav-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.ffg-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.ffg-category-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ffg-category-card:hover {
    transform: translateY(0);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.ffg-category-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.ffg-category-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.ffg-category-card strong {
    color: #667eea;
    font-size: 1.1rem;
}

.ffg-category-link {
    display: inline-block;
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
}

.ffg-category-link:hover {
    background: #764ba2;
    transform: translateY(0);
    color: white;
    text-decoration: none;
}

/* Category Page Header */
.ffg-category-page-header {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.ffg-category-page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ffg-category-page-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Responsive Design for Category Navigation */
@media (max-width: 768px) {
    .ffg-category-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .ffg-nav-header h2 {
        font-size: 2rem;
    }
    
    .ffg-category-page-header h1 {
        font-size: 2.5rem;
    }
    
    .ffg-category-page-header {
        padding: 2rem 1rem;
    }
}

/* Sticky Input Section - Fixed at Top When Scrolling */
.ffg-input-section {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: white !important;
    padding: 1rem 0 !important;
    margin-bottom: 1rem !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* WordPress Admin Bar Adjustments */
.admin-bar .ffg-input-section {
    top: 32px !important;
}

@media (max-width: 782px) {
    .admin-bar .ffg-input-section {
        top: 46px !important;
    }
}

/* Mobile Responsive Sticky */
@media (max-width: 767px) {
    .ffg-input-section {
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        background: white !important;
        padding: 0.75rem 0 !important;
        margin-bottom: 0.75rem !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    .admin-bar .ffg-input-section {
        top: 46px !important;
    }
}

@media (max-width: 575px) {
    .ffg-input-section {
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        background: white !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 0.5rem !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    .admin-bar .ffg-input-section {
        top: 46px !important;
    }
}

/* Ensure parent containers don't interfere */
.ffg-generator-container {
    position: relative !important;
    overflow: visible !important;
}

.ffg-categories-container {
    position: relative !important;
    z-index: 1 !important;
}

/* Elementor Specific Fixes */
.elementor-widget .ffg-input-section {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: white !important;
    padding: 1rem 0 !important;
    margin-bottom: 1rem !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Fallback for browsers that don't support sticky */
@supports not (position: sticky) {
    .ffg-input-section {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        background: white !important;
        padding: 1rem 2rem !important;
    }
    
    .ffg-categories-container {
        padding-top: 100px !important;
    }
    
    .admin-bar .ffg-input-section {
        top: 32px !important;
    }
    
    @media (max-width: 782px) {
        .admin-bar .ffg-input-section {
            top: 46px !important;
        }
    }
}

/* ========================================
   NEW FEATURES STYLES
   ======================================== */

/* Control Panel Styles */
.ffg-control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    min-width: 0;
}

/* Filters Toggle Button (hidden on desktop) */
.ffg-filters-toggle-btn {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid rgba(102, 126, 234, 0.25);
    background: #ffffff;
    color: #1f2937;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.ffg-filters-toggle-btn:hover {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(102,126,234,0.2);
}

.ffg-filters-toggle-svg { flex-shrink: 0; }
.ffg-filters-chevron { margin-left: 4px; }
.ffg-filters-toggle-btn[aria-expanded="true"] .ffg-filters-chevron { transform: rotate(180deg); }

.ffg-filters-collapse {
    display: contents; /* normal flow on desktop */
}

/* Theme Toggle Styles */
.ffg-theme-toggle {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.ffg-theme-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ffg-theme-btn:hover {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ffg-theme-btn:active {
    transform: translateY(0);
}

.ffg-theme-icon {
    font-size: 1.1rem;
}

.ffg-theme-btn:hover .ffg-theme-icon {
    transform: rotate(20deg);
}

/* Search Section Styles */
.ffg-search-section {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    margin: 0;
    padding: 0;
}

.ffg-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ffg-search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #e8eaed;
    border-radius: 9999px !important;
    font-size: 0.95rem;
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.ffg-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.ffg-clear-search-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffg-clear-search-btn:hover {
    background: #f0f0f0;
    color: #666;
}

/* Advanced Filters Styles */
.ffg-advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.ffg-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 auto; /* prevent shrinking so select text stays visible */
    position: relative; /* for custom chevron */
}

.ffg-filter-group label {
    display: none; /* Hide the labels to clean up the design */
}

.ffg-filter-select {
    padding: 0 40px 0 32px; /* space for custom chevron */
    border: 2px solid #e8eaed;
    border-radius: 9999px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 200px;
    width: auto;
    max-width: none;
    flex-shrink: 0; /* keep full label visible */
    appearance: none;
    background-image: none !important; /* avoid duplicate icons */
    margin: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip; /* never ellipsize labels on desktop */
}

/* Single custom chevron rendered by the group container */
.ffg-filter-group::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Dark theme chevron color */
.ffg-generator-container.dark-theme .ffg-filter-select { background-image: none !important; }
.ffg-generator-container.dark-theme .ffg-filter-group::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.ffg-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Social Sharing Styles */
.ffg-social-share {
    position: relative;
    display: inline-block;
}

.ffg-action-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 4px;
}

.ffg-action-item .ffg-social-share {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 999999;
}

.ffg-share-icon {
    stroke-width: 2;
}

.ffg-share-dropdown {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    margin-top: 8px !important;
    background: white !important;
    border: 1px solid #e8eaed !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 999999 !important;
    min-width: 180px !important;
    max-width: 200px !important;
    overflow: visible !important;
    display: none !important;
}

.ffg-share-dropdown[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Share Popup Modal Styles */
.ffg-share-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(8px) !important;
    animation: fadeIn 0.3s ease-out !important;
}

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

.ffg-share-popup-content {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4) !important;
    max-width: 450px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    animation: slideUp 0.3s ease-out !important;
}

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

.ffg-share-popup-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.ffg-share-popup-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

.ffg-share-popup-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    transition: background-color 0.2s !important;
}

.ffg-share-popup-close:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.ffg-share-popup-body {
    padding: 20px 24px 24px !important;
}

.ffg-share-preview {
    margin-bottom: 20px !important;
    padding: 16px !important;
    background: #f9fafb !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
}

.ffg-share-preview strong {
    display: block !important;
    font-size: 14px !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
}

.ffg-share-preview-text {
    font-size: 20px !important;
    color: #111827 !important;
    word-break: break-all !important;
}

.ffg-share-options {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-top: 24px !important;
}

.ffg-share-popup-option {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px 20px !important;
    background: white !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    text-align: left !important;
    position: relative !important;
    overflow: hidden !important;
}

.ffg-share-popup-option::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transition: left 0.5s !important;
}

.ffg-share-popup-option:hover {
    border-color: #667eea !important;
    background: linear-gradient(135deg, #f8faff 0%, #e0e7ff 100%) !important;
    color: #667eea !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2) !important;
}

.ffg-share-popup-option:hover::before {
    left: 100% !important;
}

.ffg-share-popup-option:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2) !important;
}

.ffg-share-popup-option .ffg-share-icon {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ffg-share-popup-option:hover .ffg-share-icon {
    transform: scale(1.1) !important;
}

/* Dark theme support */
.ffg-generator-container.dark-theme .ffg-share-popup-content {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-header {
    border-bottom-color: #374151 !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-header h3 {
    color: #f9fafb !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-close {
    color: #9ca3af !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-close:hover {
    background: #374151 !important;
    color: #f3f4f6 !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-option {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-option:hover {
    border-color: #667eea !important;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
    color: #667eea !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-option::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
}

.ffg-generator-container.dark-theme .ffg-share-preview {
    background: #111827 !important;
    border-color: #374151 !important;
}

.ffg-generator-container.dark-theme .ffg-share-preview strong {
    color: #d1d5db !important;
}

.ffg-generator-container.dark-theme .ffg-share-preview-text {
    color: #f9fafb !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-option {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
}

.ffg-generator-container.dark-theme .ffg-share-popup-option:hover {
    border-color: #667eea !important;
    background: #1e3a8a !important;
    color: #f9fafb !important;
}


.ffg-share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.ffg-share-option:last-child {
    border-bottom: none;
}

.ffg-share-option:hover {
    background: #f8f9fa;
    color: #667eea;
}

.ffg-share-option .ffg-share-icon {
    font-size: 1.1rem;
}

/* Enhanced Font Preview Styles */
.ffg-style-preview {
    position: relative;
    overflow: hidden;
}

/* Desktop: Preview text with margins for action buttons */
@media (min-width: 576px) {
.ffg-preview-text {
    position: relative;
        /* Ensure all preview text elements have proper margins */
        max-width: calc(100% - 180px) !important;
        width: calc(100% - 180px) !important;
        margin: 0 180px 0 0 !important;
    }
}

.ffg-preview-text:hover {
    transform: scale(1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Universal fix for all preview text elements - Desktop only */
@media (min-width: 576px) {
    [class*="preview-text"], 
    .ffg-preview-text,
    .ffg-style-preview .ffg-preview-text,
    .ffg-style-row .ffg-preview-text {
        max-width: calc(100% - 180px) !important;
        width: calc(100% - 180px) !important;
        margin: 0 180px 0 0 !important;
        box-sizing: border-box !important;
    }
}

/* Mobile: Full width for all preview text elements - HIGHEST PRIORITY */
@media (max-width: 575px) {
    [class*="preview-text"], 
    .ffg-preview-text,
    .ffg-style-preview .ffg-preview-text,
    .ffg-style-row .ffg-preview-text,
    .ffg-generator-container .ffg-preview-text,
    .ffg-generator-container.dark-theme .ffg-preview-text {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        white-space: pre-wrap !important;
        padding: 0.5rem !important;
    }
    
    /* Force mobile layout override */
    .ffg-style-row {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        grid-template-areas: none !important;
    }
    
    .ffg-style-preview {
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .ffg-style-actions {
        order: 2 !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: center !important;
    }
}

/* Font Item Enhancements */
.ffg-style-item {
    position: relative;
    overflow: hidden;
}

.ffg-style-item:hover {
    transform: translateY(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.ffg-style-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.ffg-style-item:hover::before {
    left: 100%;
}

/* Professional Dark Theme Styles */
.ffg-generator-container.dark-theme {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #f8f9fa;
    min-height: 100vh;
}

.ffg-generator-container.dark-theme .ffg-sticky-header {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

.ffg-generator-container.dark-theme .ffg-page-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ffg-generator-container.dark-theme .ffg-tagline {
    color: #b8c5d6;
}

.ffg-generator-container.dark-theme .ffg-text-input {
    background: rgba(20, 20, 35, 0.9) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.ffg-generator-container.dark-theme .ffg-text-input:focus {
    background: rgba(20, 20, 35, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    outline: none !important;
    box-shadow: none !important; /* remove blue glow */
}

.ffg-generator-container.dark-theme .ffg-text-input:hover {
    background: rgba(20, 20, 35, 0.9) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.ffg-generator-container.dark-theme .ffg-text-input::placeholder {
    color: #b8c5d6;
}

.ffg-generator-container.dark-theme .ffg-control-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ffg-generator-container.dark-theme .ffg-theme-btn {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(77, 171, 247, 0.3);
}

.ffg-generator-container.dark-theme .ffg-theme-btn:hover {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    box-shadow: 0 6px 20px rgba(77, 171, 247, 0.4);
    transform: translateY(0);
}

.ffg-generator-container.dark-theme .ffg-search-input,
.ffg-generator-container.dark-theme .ffg-filter-select {
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.ffg-generator-container.dark-theme .ffg-search-input:focus,
.ffg-generator-container.dark-theme .ffg-filter-select:focus {
    background: rgba(20, 20, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none !important;
    box-shadow: none !important; /* remove glow */
}

.ffg-generator-container.dark-theme .ffg-search-input::placeholder {
    color: #b8c5d6;
}

.ffg-generator-container.dark-theme .ffg-clear-search-btn {
    background: rgba(20, 20, 35, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ffg-generator-container.dark-theme .ffg-clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: #ffffff;
}

.ffg-generator-container.dark-theme .ffg-filter-group label {
    color: #e9ecef;
    font-weight: 500;
}

.ffg-generator-container.dark-theme .ffg-category-card {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    color: #f8f9fa;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ffg-generator-container.dark-theme .ffg-category-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ffg-generator-container.dark-theme .ffg-style-item {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8f9fa;
    backdrop-filter: blur(10px);
    position: relative;
}

.ffg-generator-container.dark-theme .ffg-style-item:hover {
    background: rgba(20, 20, 35, 0.95);
    border-color: #ffffff;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
    transform: translateY(0);
}

.ffg-generator-container.dark-theme .ffg-style-name {
    color: #e9ecef;
    font-weight: 500;
}

.ffg-generator-container.dark-theme .ffg-style-preview {
    background: transparent;
    border: none;
    border-radius: 8px;
}

/* Desktop: Dark theme preview text with margins for action buttons */
@media (min-width: 576px) {
.ffg-generator-container.dark-theme .ffg-preview-text {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        padding: 0.5rem 0.5rem 0.5rem 0.5rem !important;
        max-width: calc(100% - 180px) !important;
        width: calc(100% - 180px) !important;
        margin: 0 180px 0 0 !important;
    }
}

.ffg-generator-container.dark-theme .ffg-style-actions {
    position: absolute;
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 8px;
    margin: 0;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.ffg-generator-container.dark-theme .ffg-copy-btn,
.ffg-generator-container.dark-theme .ffg-share-btn,
.ffg-generator-container.dark-theme .ffg-download-btn,
.ffg-generator-container.dark-theme .ffg-like-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 8px;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer;
    margin: 0;
    padding: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.ffg-generator-container.dark-theme .ffg-copy-btn:hover,
.ffg-generator-container.dark-theme .ffg-share-btn:hover,
.ffg-generator-container.dark-theme .ffg-download-btn:hover,
.ffg-generator-container.dark-theme .ffg-like-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.ffg-generator-container.dark-theme .ffg-share-dropdown {
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.ffg-generator-container.dark-theme .ffg-share-option {
    color: #f8f9fa;
}

.ffg-generator-container.dark-theme .ffg-share-option:hover {
    background: rgba(77, 171, 247, 0.1);
    color: #4dabf7;
}

/* Notification System Styles */
.ffg-notifications-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.ffg-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    z-index: 10001;
    max-width: 350px;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ffg-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.ffg-notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.ffg-notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffg-notification-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}

.ffg-notification-content {
    flex: 1;
    min-width: 0;
}

.ffg-notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.ffg-notification-message {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.3;
    word-wrap: break-word;
}

.ffg-notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.ffg-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ffg-notification-close svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Notification Types */
.ffg-notification-copy {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.ffg-notification-share {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.3);
}

.ffg-notification-download {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3);
}

.ffg-notification-like {
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.3);
}

/* Dark Theme Notifications */
.ffg-generator-container.dark-theme .ffg-notification {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(81, 207, 102, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ffg-generator-container.dark-theme .ffg-notification-copy {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    box-shadow: 0 8px 25px rgba(51, 154, 240, 0.3);
}

.ffg-generator-container.dark-theme .ffg-notification-share {
    background: linear-gradient(135deg, #ae3ec9 0%, #9c36b5 100%);
    box-shadow: 0 8px 25px rgba(174, 62, 201, 0.3);
}

.ffg-generator-container.dark-theme .ffg-notification-download {
    background: linear-gradient(135deg, #ff922b 0%, #fd7e14 100%);
    box-shadow: 0 8px 25px rgba(255, 146, 43, 0.3);
}

.ffg-generator-container.dark-theme .ffg-notification-like {
    background: linear-gradient(135deg, #f06595 0%, #e64980 100%);
    box-shadow: 0 8px 25px rgba(240, 101, 149, 0.3);
}

/* Dark Theme for Filters Toggle Button */
.ffg-generator-container.dark-theme .ffg-filters-toggle-btn {
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    border-radius: 16px;
}

.ffg-generator-container.dark-theme .ffg-filters-toggle-btn:hover {
    background: rgba(20, 20, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    transform: translateY(0);
}

/* Dark Theme for Filters Collapse Container */
.ffg-generator-container.dark-theme .ffg-filters-collapse {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    margin-top: 0.5rem;
}

/* Dark Theme for Style Rows */
.ffg-generator-container.dark-theme .ffg-style-row {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 4px solid rgba(255, 255, 255, 0.6);
    color: #f8f9fa;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ffg-generator-container.dark-theme .ffg-style-row:hover {
    background: rgba(20, 20, 35, 0.95);
    border-left-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
    transform: translateY(0);
}

.ffg-generator-container.dark-theme .ffg-style-label-top {
    background: rgba(20, 20, 35, 0.9);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ffg-generator-container.dark-theme .ffg-style-label-top:hover {
    background: rgba(30, 30, 45, 0.95);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Dark Theme for No Fonts Message */
.ffg-generator-container.dark-theme .ffg-no-fonts {
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #b8c5d6;
}

.ffg-generator-container.dark-theme .ffg-no-fonts p {
    color: #b8c5d6;
}


/* Dark Theme for Error Messages */
.ffg-generator-container.dark-theme .ffg-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

/* Enhanced Dark Theme Animations */
.ffg-generator-container.dark-theme .ffg-style-item {
    position: relative;
    overflow: hidden;
}

.ffg-generator-container.dark-theme .ffg-style-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.ffg-generator-container.dark-theme .ffg-style-item:hover::before {
    left: 100%;
}

/* Dark Theme Scrollbar */
.ffg-generator-container.dark-theme ::-webkit-scrollbar {
    width: 8px;
}

.ffg-generator-container.dark-theme ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ffg-generator-container.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.ffg-generator-container.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design for New Features */
@media (max-width: 768px) {
    /* Show toggle on mobile/tablet */
    .ffg-filters-toggle-btn {
        display: inline-flex;
        width: auto;
        margin: 0 0 0.75rem 0;
    }

    /* Collapse container hidden by default on mobile */
    .ffg-filters-collapse {
        display: none;
        width: 100%;
    }
    
    /* Dark theme mobile filters collapse */
    .ffg-generator-container.dark-theme .ffg-filters-collapse {
        background: rgba(20, 20, 35, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    /* Dark theme mobile control panel */
    .ffg-generator-container.dark-theme .ffg-control-panel {
        background: rgba(20, 20, 35, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    /* Dark theme mobile toggle button */
    .ffg-generator-container.dark-theme .ffg-filters-toggle-btn {
        background: rgba(20, 20, 35, 0.9);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(12px);
    }
    
    .ffg-generator-container.dark-theme .ffg-filters-toggle-btn:hover {
        background: rgba(20, 20, 35, 0.95);
        border-color: rgba(255, 255, 255, 0.35);
    }

    /* When expanded */
    .ffg-filters-collapse.is-open {
        display: block;
    }

    /* Make sections full width inside collapse and remove stray margins */
    .ffg-filters-collapse .ffg-search-section,
    .ffg-filters-collapse .ffg-advanced-filters,
    .ffg-filters-collapse .ffg-theme-toggle {
        width: 100% !important;
        padding: 0;
    }

    /* Enforce even spacing between blocks via margins */
    .ffg-filters-collapse > * { margin: 0 !important; }
    .ffg-filters-collapse > * + * { margin-top: 12px !important; }
    .ffg-filters-collapse .ffg-advanced-filters > * { margin: 0 !important; }
    .ffg-filters-collapse .ffg-advanced-filters > * + * { margin-top: 12px !important; }
    /* Remove any bottom margins from inner controls to prevent extra space */
    .ffg-filters-collapse input,
    .ffg-filters-collapse select,
    .ffg-filters-collapse button {
        margin: 0;
    }
    .ffg-control-panel {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 16px;
        margin-bottom: 2rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Mobile filters toggle button styling */
    .ffg-filters-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        background: #667eea;
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .ffg-filters-toggle-btn:hover {
        background: #5a67d8;
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    
    .ffg-theme-toggle {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .ffg-theme-btn {
        width: 100%;
        max-width: 200px;
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 12px;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
    
    .ffg-search-section {
        width: 100%;
        max-width: none;
        margin: 0; /* remove extra bottom space to normalize gaps */
    }
    
    .ffg-search-input-wrapper {
        position: relative;
        width: 100%;
        display: block;
        margin: 0; /* prevent extra space */
    }
    
    .ffg-search-input {
        width: 100%;
        padding: 16px 50px 16px 20px;
        font-size: 16px;
        border-radius: 9999px;
        border: 2px solid #e1e5e9;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }
    
    .ffg-search-input:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .ffg-clear-search-btn {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        font-size: 20px;
        color: #6c757d;
        cursor: pointer;
        padding: 6px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .ffg-clear-search-btn:hover {
        background: #f8f9fa;
        color: #495057;
        transform: translateY(-50%) scale(1.1);
    }
    
    .ffg-advanced-filters {
        flex-direction: column;
        width: 100%;
        gap: 0.15rem; /* match unified spacing */
        margin: 0;
        padding: 0;
    }
    
    .ffg-filter-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0;
    }
    
    .ffg-filter-group label {
        display: none; /* Hide the labels on mobile too */
    }
    
    .ffg-filter-select {
        width: 100%;
        padding: 0 40px 0 32px; /* room for custom chevron */
        font-size: 16px;
        border: 2px solid #e1e5e9;
        border-radius: 9999px;
        background: #ffffff;
        color: #495057;
        cursor: pointer;
        appearance: none;
        background: #ffffff; /* ensure no sprite duplication */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden; /* avoid pushing layout */
        text-overflow: clip; /* show full label if space allows */
    }
    
    
    .ffg-filter-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    /* Force all direct children in the panel to take full width */
    .ffg-control-panel > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Ensure search box takes full width and doesn't overflow */
    .ffg-search-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }
    
    .ffg-search-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    .ffg-search-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        text-overflow: ellipsis !important;
    }
    
    .ffg-share-dropdown {
        right: auto;
        left: 0;
        min-width: 180px;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .ffg-control-panel {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
        align-items: stretch;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .ffg-theme-btn {
        padding: 12px 20px;
        font-size: 14px;
        max-width: 180px;
        width: 100% !important;
    }
    
    .ffg-search-input {
        padding: 14px 45px 14px 16px;
        font-size: 16px;
        border-radius: 9999px;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Dark theme mobile search and filters */
    .ffg-generator-container.dark-theme .ffg-search-input {
        background: rgba(20, 20, 35, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }
    
    .ffg-generator-container.dark-theme .ffg-filter-select {
        background: rgba(20, 20, 35, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: #ffffff;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    }
    
    .ffg-clear-search-btn {
        right: 12px;
        font-size: 18px;
        width: 28px;
        height: 28px;
    }
    
    .ffg-filter-group label {
        display: none; /* Hide the labels on small mobile too */
    }
    
    .ffg-filter-select {
        padding: 0 40px 0 32px; /* room for custom chevron */
        font-size: 15px;
        border-radius: 9999px;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        appearance: none;
        white-space: nowrap;
        overflow: visible;
        text-overflow: ellipsis;
    }
    
    /* Extra mobile fixes for search box */
    .ffg-search-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .ffg-search-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .ffg-filters-toggle-btn {
        margin-bottom: 0.5rem;
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Slightly tighter spacing on very small screens - use margins instead of gap */
    .ffg-filters-collapse.is-open > * + * { margin-top: 10px !important; }
}

/* Animation for filtered items */
.ffg-style-item.filtered-out {
    opacity: 0;
    transform: scale(1);
    pointer-events: none;
}

.ffg-style-item.filtered-in {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Show All Styles Button */
.ffg-show-all-styles {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ffg-show-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ffg-show-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.ffg-show-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ffg-show-all-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.ffg-show-all-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.ffg-show-all-btn:hover .ffg-show-all-icon {
    transform: translateX(2px);
}

/* Dark theme for Show All button */
.ffg-generator-container.dark-theme .ffg-show-all-styles {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.ffg-generator-container.dark-theme .ffg-show-all-btn {
    background: linear-gradient(135deg, #4c63d2 0%, #6b46a3 100%);
    box-shadow: 0 2px 8px rgba(76, 99, 210, 0.3);
}

.ffg-generator-container.dark-theme .ffg-show-all-btn:hover {
    box-shadow: 0 4px 16px rgba(76, 99, 210, 0.4);
}

/* Responsive adjustments for Show All button */
@media (max-width: 768px) {
    .ffg-show-all-styles {
        margin-top: 1rem;
        padding: 0.75rem 0;
    }
    
    .ffg-show-all-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .ffg-show-all-text {
        font-size: 0.875rem;
    }
    
    .ffg-show-all-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .ffg-show-all-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .ffg-show-all-text {
        font-size: 0.8rem;
    }
    
    .ffg-show-all-icon {
        width: 12px;
        height: 12px;
    }
}

/* Sticky Input & Filters Widget Styles */
.ffg-input-filters-widget {
    width: 100%;
    margin-bottom: 20px;
}

.ffg-input-filters-widget.ffg-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ffg-input-filters-widget.ffg-sticky-header.ffg-sticky-active {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Small Popup Notifications for Actions */
.ffg-action-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 300px;
    min-width: 200px;
}

.ffg-action-notification.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ffg-action-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.ffg-action-notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.ffg-action-notification.like {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.ffg-action-notification-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ffg-action-notification-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2.5;
}

.ffg-action-notification-text {
    flex: 1;
    line-height: 1.4;
}

/* Mobile adjustments for notifications */
@media (max-width: 768px) {
    .ffg-action-notification {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
        min-width: auto;
    }
}

