/* tools.css - Shared UI for AI Tools
   Contents:
   1. Core Layout & Headers
   2. Tool Navigation (Toggles)
   3. Image Enhancer / Preview UI
   4. Upload Panels & Dropzones
   5. Action Buttons & Controls
   6. Magic Editor Specifics
   7. Result Panels
   8. Galleries & Showcases
   9. Info, Features & Premium Content
   10. History & FAQ
   11. Animations & Loaders
   12. Responsive Rules
*/


/* -------------------------------------------------------------------------- */
/*                        1. CORE LAYOUT & HEADERS                            */
/* -------------------------------------------------------------------------- */

.tool-page {
    background-color: var(--home-bg);
    color: var(--home-text-main);
    padding: 160px 0 100px;
    min-height: 100vh;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-page-image-enhancer-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Tool Header */
.tool-page-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 60px auto;
}

.tool-hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    background: var(--home-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-page-subtitle {
    font-size: 1.1rem;
    color: var(--home-text-muted);
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}


/* -------------------------------------------------------------------------- */
/*                       2. TOOL NAVIGATION (TOGGLES)                         */
/* -------------------------------------------------------------------------- */

.tool-toggle-wrapper {
    display: flex;
    padding: 6px;
    border-radius: 999px;
    margin: 20px auto 70px auto;
    position: relative;
    left: auto;
    transform: none;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 90vw;
    z-index: 10;
    background: transparent;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px -5px rgba(90, 53, 222, 0.25), 0 0 20px rgba(6, 182, 212, 0.2);
    border: none;
    overflow: hidden;
}

.tool-toggle-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(115deg, var(--home-primary), #005bff7a, #ffffff, #5106d4, var(--home-primary));
    background-size: 300% 300%;
    animation: running-stroke 8s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
}

.tool-toggle-wrapper:hover::before {
    animation-duration: 3s;
}

.tool-toggle-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 2px;
}

.tool-toggle-scroll::-webkit-scrollbar {
    display: none;
}

.tool-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 999px;
    color: var(--home-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    z-index: 3;
}

.tool-toggle-pill i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.tool-toggle-pill:hover {
    color: var(--text-main);
    background-size: 300% 300%;
    animation: running-stroke 8s linear infinite;
    border: 1px solid var(--glass-border);
}

.tool-toggle-pill:hover i {
    transform: scale(1.15) rotate(5deg);
}

.tool-toggle-pill.active {
    background: linear-gradient(115deg, var(--home-primary), #424aff99, #5106d4, var(--home-primary));
    background-size: 300% 300%;
    animation: running-stroke 8s linear infinite;
    color: #fff;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}


/* -------------------------------------------------------------------------- */
/*                       3. IMAGE ENHANCER / PREVIEW UI                       */
/* -------------------------------------------------------------------------- */

.enhancer-preview-box {
    position: relative;
    width: 100%;
    background-color: #0f0f11;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--home-border);
    -webkit-user-select: none;
    user-select: none;
}

#previewOriginal {
    width: 100%;
    display: block;
    z-index: 1;
    position: relative;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

#previewEnhanced {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 2;
    background-color: #0f0f11;
    transition: none !important;
    will-change: clip-path;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    background-image:
        linear-gradient(45deg, #1e1e24 25%, transparent 25%),
        linear-gradient(-45deg, #1e1e24 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e1e24 75%),
        linear-gradient(-45deg, transparent 75%, #1e1e24 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Magic Editor Override - Single Image View */
.tool-page-magic-editor #previewOriginal {
    clip-path: none !important;
}

.enhancer-slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: white;
    z-index: 10;
    cursor: ew-resize;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.enhancer-slider-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--home-primary);
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

#compareSlider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    opacity: 0;
    cursor: ew-resize;
}

.tool-preview-tip {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--home-text-muted);
}


/* -------------------------------------------------------------------------- */
/*                       4. UPLOAD PANELS & DROPZONES                         */
/* -------------------------------------------------------------------------- */

.tool-panel-card {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tool-dropzone {
    border: 2px dashed var(--home-border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.tool-dropzone:hover {
    border-color: var(--home-primary);
    background: rgba(90, 53, 222, 0.05);
    transform: translateY(-2px);
}

.tool-upload-icon {
    font-size: 2.5rem;
    color: var(--home-text-muted);
    margin-bottom: 16px;
}

.tool-dropzone-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--home-text-main);
}

.tool-dropzone-sub {
    font-size: 0.9rem;
    color: var(--home-text-muted);
    margin-bottom: 20px;
}

.tool-dropzone-btn {
    background: transparent;
    border: 1px solid var(--home-border);
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--home-text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tool-dropzone-btn:hover {
    background: var(--home-card-hover);
    border-color: var(--home-text-muted);
}

.tool-dropzone.disabled {
    opacity: 0.5;
    pointer-events: none !important;
    filter: grayscale(1);
    cursor: not-allowed !important;
}

/* Success Toast */
.tool-dropzone-success {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--home-bg);
    border: 1px solid var(--home-border);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 30;
    width: 90%;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.3s ease;
}

.tool-dropzone-success span {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.tool-dropzone-success i {
    color: #10b981;
}

/* Terms Notice */
.tool-terms-notice {
    margin: 10px;
    font-size: 0.8rem;
    color: var(--home-text-muted);
    text-align: center;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--home-border);
    display: block;
}

.tool-terms-notice a {
    color: var(--home-primary);
    text-decoration: none;
    font-weight: 500;
}

.tool-terms-notice a:hover {
    text-decoration: underline;
}


/* -------------------------------------------------------------------------- */
/*                      5. ACTION BUTTONS & CONTROLS                          */
/* -------------------------------------------------------------------------- */

.tool-scale-row {
    margin: 20px 0;
}

.tool-scale-label {
    font-size: 0.85rem;
    color: var(--home-text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.tool-scale-buttons {
    display: flex;
    gap: 8px;
}

.scale-btn {
    background: transparent;
    border: 1px solid var(--home-border);
    color: var(--home-text-muted);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex: 1;
}

.scale-btn:hover,
.scale-btn.scale-btn-active {
    background: var(--home-card-bg);
    border-color: var(--home-primary);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(90, 53, 222, 0.3);
}

.tool-enhance-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--home-primary);
    color: white;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(90, 53, 222, 0.3);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.tool-enhance-btn:not(:disabled):hover {
    background: var(--home-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(90, 53, 222, 0.4);
}

.tool-enhance-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #333;
    box-shadow: none;
    color: #888;
}

.tool-download-btn {
    background: var(--home-gradient);
    display: flex;
    text-align: center;
    text-decoration: none;
    justify-content: center;
    align-items: center;
}

.tool-download-btn:not(:disabled):hover {
    background: var(--home-gradient);
}

.tool-reset-btn {
    background: transparent;
    border: 1px solid var(--home-border);
    color: var(--home-text-muted);
    box-shadow: none;
}

.tool-reset-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--home-text-main);
    border-color: var(--home-text-main);
}


/* -------------------------------------------------------------------------- */
/*                       6. MAGIC EDITOR SPECIFICS                            */
/* -------------------------------------------------------------------------- */

.magic-prompt-container {
    margin: 24px 0;
}

.magic-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.magic-prompt-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--home-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.magic-prompt-label i {
    background: var(--home-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.magic-prompt-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--home-border);
    border-radius: 16px;
    padding: 4px;
    transition: all 0.3s ease;
}

.magic-prompt-wrapper:focus-within {
    border-color: var(--home-primary);
    background: rgba(90, 53, 222, 0.05);
    box-shadow: 0 0 0 4px rgba(90, 53, 222, 0.1);
}

.magic-prompt-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--home-text-main);
    font-size: 1rem;
    line-height: 1.6;
    padding: 16px;
    resize: none;
    outline: none;
    min-height: 100px;
    font-family: inherit;
}

.magic-prompt-textarea::placeholder {
    color: var(--home-text-muted);
    opacity: 0.7;
}

.magic-prompt-hint {
    font-size: 0.8rem;
    color: var(--home-text-muted);
    margin-top: 8px;
    display: block;
    text-align: right;
}


/* -------------------------------------------------------------------------- */
/*                           7. RESULT PANELS                                 */
/* -------------------------------------------------------------------------- */

.tool-result-panel {
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

.tool-result-image-box {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #0f0f11;
    border: 1px solid var(--home-border);
}

.tool-result-img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tool-result-img.loaded {
    opacity: 1;
}


/* -------------------------------------------------------------------------- */
/*                       8. GALLERIES & SHOWCASES                             */
/* -------------------------------------------------------------------------- */

.tool-sample-section {
    margin-top: 30px;
    text-align: center;
}

.tool-sample-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--home-text-muted);
    margin-bottom: 12px;
}

.tool-sample-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tool-sample-item {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #000;
}

.tool-sample-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.tool-sample-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tool-sample-item:hover img {
    opacity: 1;
}

.tool-sample-item.active {
    border-color: var(--home-primary);
    box-shadow: 0 0 0 3px rgba(90, 53, 222, 0.3);
}

.tool-sample-item.active img {
    opacity: 1;
}

/* Larger Gallery Section */
.gallery-section {
    padding: 100px 0;
    background: var(--home-bg-secondary);
    border-top: 1px solid var(--home-border);
}

.gallery-section-title {
    margin-bottom: 60px;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--home-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-item {
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1/1;
    cursor: pointer;
    position: relative;
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: var(--home-primary);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover img {
    transform: scale(1.1);
}


/* -------------------------------------------------------------------------- */
/*                  9. INFO, FEATURES & PREMIUM CONTENT                       */
/* -------------------------------------------------------------------------- */

.info-section {
    padding: 100px 0;
    background: var(--home-bg-secondary);
    border-top: 1px solid var(--home-border);
}

.info-section .section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.info-section .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--home-text-main);
}

.info-section .section-subtitle {
    font-size: 1.1rem;
    color: var(--home-text-muted);
}

.glass-panel {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 24px;
    padding: 40px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
}

.info-desc {
    color: var(--home-text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.info-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--home-text-main);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.info-card-center {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.info-card-center:hover {
    transform: translateY(-5px);
    background: var(--home-card-hover);
    border-color: rgba(90, 53, 222, 0.3);
}

.info-icon-center {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.info-icon-center i {
    color: #fff;
}

.info-card-center:hover .info-icon-center {
    transform: scale(1.1) rotate(5deg);
}

/* Background Color Helpers */
.bg-primary-10 {
    background: rgba(99, 102, 241, 0.9);
    color: #6366f1;
}

.bg-pink-10 {
    background: rgba(236, 72, 153, 0.9);
    color: #ec4899;
}

.bg-green-10 {
    background: rgba(16, 185, 129, 0.9);
    color: #10b981;
}

.bg-amber-10 {
    background: rgba(245, 158, 11, 0.9);
    color: #f59e0b;
}

.bg-red-10 {
    background: rgba(239, 68, 68, 0.9);
    color: #ef4444;
}

.bg-purple-10 {
    background: rgba(139, 92, 246, 0.9);
    color: #8b5cf6;
}

/* Feature Rows (Text + Image Side-by-Side) */
.feature-row {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
    opacity: 0;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
}

.feature-media {
    flex: 1;
    position: relative;
}

.feature-img-box {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--home-border);
    background: var(--home-card-bg);
}

.feature-img-box img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.feature-img-box:hover img {
    transform: scale(1.03);
}

.feature-label {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.feature-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(to right, #7d3aff, #2680ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.feature-desc {
    font-size: 1.05rem;
    color: var(--home-text-muted);
    line-height: 1.7;
    margin-bottom: 30px;
}

.feature-list {
    margin-left: 1.5em;
}

/* 3-Step "How it works" */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px auto;
}

.step-card {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: rgba(90, 53, 222, 0.3);
    background: var(--home-card-hover);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--home-primary), #4f46e5);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.step-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--home-text-main);
}

.step-desc {
    font-size: 0.95rem;
    color: var(--home-text-muted);
    line-height: 1.6;
}


/* -------------------------------------------------------------------------- */
/*                          10. HISTORY & FAQ                                 */
/* -------------------------------------------------------------------------- */

.history-section {
    width: 100%;
    margin-top: 40px;
    display: none;
}

.history-title {
    font-size: 1.1rem;
    color: var(--home-text-muted);
    margin-bottom: 12px;
}

.history-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.history-img {
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}


/* -------------------------------------------------------------------------- */
/*                       11. ANIMATIONS & LOADERS                             */
/* -------------------------------------------------------------------------- */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes simpleFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: simpleFadeIn 0.8s ease forwards;
}

@keyframes running-stroke {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes shimmerMove {
    from {
        background-position: -200% 0;
    }

    to {
        background-position: 200% 0;
    }
}

.fade-up-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up-element.in-view,
.fade-up-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button Loading States */
.btn-label-loading,
.btn-spinner {
    display: none;
}

.tool-enhance-btn.loading .btn-label-default {
    display: none;
}

.tool-enhance-btn.loading .btn-label-loading,
.tool-enhance-btn.loading .btn-spinner {
    display: inline-block;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-left: 8px;
    vertical-align: middle;
}

/* Skeleton Loaders */
#skeletonOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

#skeletonOverlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 60%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmerMove 2s infinite linear;
    pointer-events: none;
    z-index: -1;
}

#skeletonOverlay.active {
    opacity: 1;
    pointer-events: all;
}

.skeleton-loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, var(--home-primary) 50%, transparent 100%);
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    position: relative;
}

.skeleton-loader::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: #0f172a;
    border-radius: 50%;
}

#skeletonText {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

.hidden {
    display: none !important;
}


/* -------------------------------------------------------------------------- */
/*                          12. RESPONSIVE RULES                              */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .tool-page-image-enhancer-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .tool-page {
        padding-top: 120px;
    }

    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .feature-text {
        order: 2;
    }

    .feature-media {
        order: 1;
        width: 100%;
    }

    .feature-title {
        font-size: 1.8rem;
    }

    .tool-hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .tool-hero-title {
        font-size: 2.2rem;
    }

    .container {
        padding: 0 10px;
    }

    .tool-scroll-box {
        width: 100%;
        padding: 5px 0 20px 0;
        margin-bottom: -10px;
        display: flex;
        justify-content: center;
    }

    .tool-toggle-wrapper {
        display: flex;
        margin: 10px auto;
        left: auto;
        transform: none;
        width: fit-content;
        max-width: 95vw;
        flex-shrink: 0;
        overflow-x: hidden;
        justify-content: center;
        border-radius: 50px;
        background: var(--home-bg);
        box-shadow: 0 5px 20px -5px rgba(90, 53, 222, 0.25), 0 0 20px rgba(6, 182, 212, 0.2);
        padding: 4px;
    }

    .tool-toggle-wrapper::before {
        display: block;
        border-radius: 50px;
    }

    .tool-toggle-scroll {
        justify-content: flex-start;
        gap: 20px;
    }

    .tool-toggle-pill {
        flex: 0 0 auto;
        font-size: 0.72rem;
        padding: 7px 10px;
        gap: 5px;
    }

    .tool-toggle-pill i {
        font-size: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-header {
        font-size: 0.95rem;
    }
}