/* css/components.css */

/* Styles for main page components like Hero Slider, Tools Sections, Info, FAQ */

/* Hero Slider */
.hero-slider { padding: 4rem 0; background-color: var(--bg-card); transition: background-color 0.3s; }
.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: border-color 0.3s;
    margin: 0 auto;
    width: 100%;
    max-width: 80%;
    padding: 2rem 0;
}
.slider-container.grabbing { cursor: grabbing; user-select: none; }
.slides-wrapper { display: flex; }
.slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    padding: 2rem 3rem;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.slide.active { opacity: 1; }
.slide-content { flex: 1.2; pointer-events: none; }
.slide-content h2 { font-size: clamp(1.75rem, 5vw, 3rem); margin-bottom: 0.5rem; font-weight: 800; }
.slide-content p { font-size: clamp(.9rem, 2.5vw, 1.1rem); color: var(--text-secondary); margin-bottom: 2rem; }

.slide-visual {
    flex: 1;
    pointer-events: none;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slide-visual .image-wrapper {
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
}
.slide-visual img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    max-height: 150px;
}

.slider-nav { position: absolute; bottom: 1.5rem; left: 3rem; right: 3rem; display: flex; align-items: center; gap: 15px; }
.progress-bar-container { flex-grow: 1; background: var(--border-color); border-radius: 5px; height: 4px; overflow: hidden; }
.progress-bar { 
    height: 100%; 
    width: 0; 
    background-image: linear-gradient(to right, var(--accent-color), #2563eb, #1a4ed8); 
    background-size: 100% 100%; 
}
html[data-theme="dark"] .progress-bar {
    background-image: linear-gradient(to right, var(--accent-color), #3080ff, #1c68ff); 
}
.progress-bar.progress-active { animation: fill-progress 5s linear forwards; }
@keyframes fill-progress { from { width: 0%; } to { width: 100%; } }
.slider-dots { display: flex; gap: 15px; }
.slider-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: var(--border-color); cursor: pointer; transition: background 0.2s; padding: 0; }
.slider-dots button.active { background: var(--text-primary); }


/* Tools Sections & View Toggle */
.tools-section { padding: 4rem 0; }
.tools-section-highlight { background-color: var(--bg-highlight); transition: background-color 0.3s; }
.tools-section-highlight .tool-card { box-shadow: 0 0 0 1px transparent, 0 4px 12px 0 var(--shadow-color); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.section-title { 
    font-size: clamp(1.5rem, 4vw, 2.25rem); 
    margin-bottom: 0; text-align: left; 
}
.section-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.25rem); 
    color: var(--text-secondary);
    margin-top: 0.25rem; 
    margin-bottom: 2rem;
    max-width: 750px;
    line-height: 1.6;
}
.section-header .section-title { margin-bottom: 0; }


.view-toggle { display: flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.view-toggle button { background: transparent; border: none; padding: .5rem 1rem; cursor: pointer; color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: .5rem; transition: background-color 0.2s, color 0.2s; }
.view-toggle button:not(:last-child) { border-right: 1px solid var(--border-color); }
.view-toggle button.active { background-color: var(--btn-primary-bg); color: var(--btn-primary-text); }
.view-toggle button:not(.active):hover { background-color: var(--bg-main); }
.view-toggle button i { 
    font-size: 1.1em; 
    line-height: 1;
}

/* Popular Tools: Entire Card Clickable */
.tool-card-link {
    text-decoration: none; 
    display: block; 
    color: inherit; 
    height: 100%; 
}
.tools-grid { 
    display: grid; 
    gap: 1.5rem; 
    grid-template-columns: repeat(3, 1fr); 
    align-items: stretch; 
}
.tool-card { 
    background-color: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 16px; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: all .3s ease-in-out; 
    height: 100%; 
}
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px var(--shadow-medium); } 
.card-visual { position: relative; display: flex; align-items: center; padding: 1rem 2rem 1rem 1rem; }

.tool-card .image-wrapper { 
    flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1rem; border-radius: 12px; border: 1px solid; min-height: 120px;
    background-image: var(--grid-svg-gray); 
    border-color: var(--border-color); 
}
.tool-card .image-wrapper h3 { font-size: 2rem; font-weight: 800; color: var(--text-secondary); }
.vertical-text { position: absolute; top: 50%; right: .5rem; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; color: #a1a1aa; font-size: .7rem; font-weight: 500; letter-spacing: .1em; user-select: none; transition: opacity .2s; }
.card-content { 
    padding: 1.5rem; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
}
.card-content h3 { font-size: clamp(1.05rem, 3vw, 1.25rem); font-weight: 800; margin-bottom: 0.25rem; }
.card-content p { font-size: clamp(.875rem, 2.5vw, 1rem); color: var(--text-secondary); }

/* Specific grid background and border colors for image-wrappers */
.grid-bg-gray {
    background-image: var(--grid-svg-gray);
    border-color: var(--border-grid-gray-light) !important;
}
html[data-theme="dark"] .grid-bg-gray {
    border-color: var(--border-grid-gray-dark) !important;
}
.grid-bg-blue { background-image: var(--grid-svg-blue); border-color: #93c5fd !important; } 
html[data-theme="dark"] .grid-bg-blue { border-color: #2563eb !important; }
.grid-bg-yellow { background-image: var(--grid-svg-yellow); border-color: #fcd34d !important; } 
html[data-theme="dark"] .grid-bg-yellow { border-color: #d97706 !important; }
.grid-bg-green { background-image: var(--grid-svg-green); border-color: #6ee7b7 !important; } 
html[data-theme="dark"] .grid-bg-green { border-color: #059669 !important; }


.tools-grid-large { 
    display: grid; 
    gap: 1.5rem; 
    align-items: stretch; 
}
.tools-grid-large.view-grid { grid-template-columns: repeat(4, 1fr); }
.tools-grid-large.view-list { grid-template-columns: repeat(2, 1fr); }

/* Styles for when list view is active on #tool-categories-container */
.tools-grid-large.view-list .tool-card { flex-direction: row; align-items: center; }
.tools-grid-large.view-list .card-visual { flex: 0 0 90px; padding-right: 1rem; }
.tools-grid-large.view-list .tool-card .image-wrapper { min-height: 40px; padding: 0.5rem; } 
.tools-grid-large.view-list .tool-card .image-wrapper h3 { font-size: 1.5rem; }
.tools-grid-large.view-list .vertical-text { opacity: 0; }
.tools-grid-large.view-list .card-content { padding: 1rem 1.5rem 1rem 0; }

/* Info Sections (How-To, Redesigned) */
.info-section {
    padding: 4rem 0;
    margin-bottom: 4rem; 
    position: relative; 
}
.info-section .section-title { 
    text-align: center;
    margin-bottom: 0.5rem; 
}
.info-section .section-subtitle {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem; 
    font-size: 1.25rem; 
    color: var(--text-secondary);
    line-height: 1.6;
}

.simple-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 3rem; 
    position: relative; 
    padding: 0 1rem; 
    counter-reset: step-counter; 
}

/* Vertical connecting line for desktop */
@media (min-width: 769px) {
    .simple-steps-grid::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px; 
        background-color: var(--border-color);
        transform: translateX(-50%);
        opacity: 0.5;
        z-index: 0;
    }
}
html[data-theme="dark"] .simple-steps-grid::before {
    background-color: var(--border-grid-gray-dark);
}

.step-item {
    text-align: center;
    padding: 0.75rem;
    position: relative;
    z-index: 1; 
}

.step-icon-circle {
    width: 70px; 
    height: 70px;
    background-color: var(--accent-color); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto; 
    box-shadow: 0 4px 8px var(--shadow-medium);
    color: var(--text-light); 
    font-size: 2.5rem; 
    font-weight: bold; 
    position: relative;
    z-index: 2; 
    border: 3px solid var(--bg-card); 
    counter-increment: step-counter; 
}
.step-icon-circle::before { 
    content: counter(step-counter); 
    position: absolute;
    font-size: 1.2rem; 
    font-weight: 700;
    line-height: 1;
    color: var(--text-light);
}

.step-icon-circle i { 
    font-size: 2.5rem;
    line-height: 1; 
}

.step-item h3 {
    font-size: 1.25rem; 
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.step-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ Accordion Styling */
.faq-section { padding: 2rem; }
.faq-section .section-title {
    text-align: left; 
    margin-bottom: 1.5rem;
}
.faq-item {
    border: 1px solid var(--border-color); 
    margin-bottom: 0.75rem; 
    border-radius: 12px; 
    overflow: hidden; 
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.faq-item:last-child {
    margin-bottom: 0;
}
.faq-item summary {
    font-weight: 600;
    font-size: 1.125rem; 
    padding: 1rem 1.5rem; 
    cursor: pointer;
    list-style: none; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card); 
    border-radius: 12px; 
    transition: background-color 0.1s ease, color 0.1s ease, border-radius 0.2s;
}
.faq-item summary:hover {
    background-color: var(--bg-highlight);
    color: var(--accent-color);
}
.faq-item[open] summary {
    background-color: var(--bg-highlight); 
    color: var(--accent-color); 
    border-bottom-left-radius: 0; 
    border-bottom-right-radius: 0;
}
.faq-item summary::-webkit-details-marker { display: none; }

/* FAQ Icons: Font Awesome Plus/Plane */
.faq-icon-group {
    display: flex;
    align-items: center;
    font-size: 1.3em; 
    color: var(--text-secondary);
    position: relative; 
    width: 1.3em; 
    height: 1.3em;
    justify-content: center;
    transition: color 0.2s;
}

.faq-icon-group .faq-arrow-icon,
.faq-icon-group .faq-plane-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.faq-item:not([open]) .faq-icon-group .faq-arrow-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}
.faq-item:not([open]) .faq-icon-group .faq-plane-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg); 
}

.faq-item[open] .faq-icon-group .faq-arrow-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg); 
}
.faq-item[open] .faq-icon-group .faq-plane-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg); 
    color: var(--accent-color); 
}


.faq-item .faq-content { 
    padding: 0 1.5rem 1.5rem 1.5rem; 
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    background-color: var(--bg-card); 
    border-bottom-left-radius: 12px; 
    border-bottom-right-radius: 12px;
}
.faq-item .faq-content p:last-child, 
.faq-item .faq-content ul:last-child,
.faq-item .faq-content ol:last-child {
    margin-bottom: 0;
}
.faq-item .faq-content ul, .faq-item .faq-content ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}
.faq-item .faq-content li {
    margin-bottom: 0.5rem;
}

/* --- Support Us Section (Redesigned) --- */
.support-us-section {
    text-align: center;
    position: relative;
    z-index: 1; 
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-highlight) 100%); 
    border: 1px solid var(--border-color);
    border-radius: 24px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); 
    margin: var(--space-xxxl) auto; 
    max-width: 650px; 
    overflow: hidden; 
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}
html[data-theme="dark"] .support-us-section {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    box-shadow: 0 10px 40px rgba(255,255,255,0.04);
}

/* Highlighted state (when scrolled into view) */
.support-us-section.highlighted {
    transform: translateY(-8px); 
    box-shadow: 0 15px 45px rgba(0, 123, 255, 0.15); 
    border-color: var(--accent-color);
    /* margin: 1rem auto;  -- Moved this to the specific media query below */
}
html[data-theme="dark"] .support-us-section.highlighted {
    box-shadow: 0 15px 45px rgba(88, 166, 255, 0.1);
}

.support-us-section .container { 
    max-width: 100%; 
    padding: 0; 
}

.support-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-xl); 
}

.support-icon {
    font-size: 3.5rem; 
    color: var(--accent-color); 
    margin-bottom: var(--space-md);
    transition: all 0.3s ease-in-out;
    display: block; 
}
.support-us-section:hover .support-icon {
    transform: rotate(5deg) scale(1.1); 
}

.support-card-content h3 { 
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}
.support-card-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0; 
    max-width: 85%; 
    margin-left: auto;
    margin-right: auto;
}

.support-card-footer {
    display: flex;
    justify-content: center;
    gap: var(--space-md); 
    width: 100%; 
    margin-top: var(--space-md);
}

.coffee-btn { 
    background-color: #E2B05E; 
    color: #3D2B1F; 
    border-color: #E2B05E;
    font-weight: 700;
    padding: var(--space-md) var(--space-xl); 
    border-radius: 10px; 
    box-shadow: 0 4px 15px rgba(226, 176, 94, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.coffee-btn:hover {
    background-color: #d8a051; 
    border-color: #d8a051;
    box-shadow: 0 6px 20px rgba(226, 176, 94, 0.4);
    transform: translateY(-2px);
}
html[data-theme="dark"] .coffee-btn {
    background-color: #f7c975;
    color: #4a2c0f;
    border-color: #f7c975;
    box-shadow: 0 4px 15px rgba(247, 201, 117, 0.2);
}
html[data-theme="dark"] .coffee-btn:hover {
    background-color: #e6b06b;
    border-color: #e6b06b;
    box-shadow: 0 6px 20px rgba(247, 201, 117, 0.3);
}


.share-btn { 
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 500;
    padding: var(--space-md) var(--space-xl);
    border-radius: 10px;
    box-shadow: none;
    transition: all 0.2s ease-in-out;
}
.share-btn:hover {
    background-color: var(--bg-highlight);
    color: var(--text-primary);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}


/* Contact Section (now with a button that opens a popup) */
.support-contact-section { padding: 4rem 0; }
.support-contact-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 2rem; 
}
.support-contact-grid .info-card {
    max-width: 650px; 
    margin: 0 auto; 
    text-align: center;
}
.support-contact-grid .info-card h3 {
    font-size: var(--fs-2xl); 
}
.support-contact-grid .info-card .btn {
    margin-top: 1.5rem; 
}

/* Floating Support Button */
.floating-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: var(--accent-color);
    color: var(--btn-primary-text);
    padding: 1rem 1.5rem;
    border-radius: 9999px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 999; 
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none; 
}
.floating-btn.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all; 
}
.floating-btn:hover {
    background-color: var(--btn-primary-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.floating-btn i {
    font-size: 1.2em;
}

/* Support Tool CTA (Buy me a coffee specific for this tool) */
.support-tool-cta { 
    text-align: center;
    margin-top: var(--space-xl);
    padding: var(--space-lg);
}
.support-tool-icon {
    font-size: 2.8rem;
    color: var(--accent-color);
    margin-bottom: var(--space-sm);
    display: block;
}
.support-tool-cta h3.h4 { 
    font-size: var(--fs-lg);
    margin-bottom: var(--space-xs);
}
.support-tool-cta p {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto var(--space-md) auto;
}
.coffee-btn-small { 
    font-size: var(--fs-sm);
    padding: var(--space-sm) var(--space-md);
}

/* MOBILE RESPONSIVENESS ADJUSTMENTS */
@media (max-width: 1200px) { 
    .tools-grid-large.view-grid { grid-template-columns: repeat(3, 1fr); }
    .tools-grid-large.view-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) { 
    .tools-grid-large.view-grid { grid-template-columns: repeat(2, 1fr); } 
    .tools-grid-large.view-list { grid-template-columns: 1fr; } 
    .simple-steps-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));}
}
@media (max-width: 768px) { 
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 1rem; }
    .tools-grid { grid-template-columns: 1fr; } 
    .tool-card .card-content h3 { font-size: 1.125rem; }
    .tool-card .card-content p { font-size: 0.875rem; }
    .step-item h3 { font-size: 1.125rem; }
    .step-item p { font-size: 0.875rem; }
    .faq-item summary { font-size: 1rem; }
    .faq-item .faq-content { font-size: 0.875rem; }

    /* Hero slider image alignment for smaller screens: Content on top, image on bottom */
    .slide {
        flex-direction: column; 
        text-align: center;
        padding: 1.5rem; 
    }
    .slide-visual {
        order: 2; 
        width: 100%;
        margin-top: 1.5rem; 
        padding: 0; 
    }
    .slide-content {
        order: 1; 
        width: 100%;
        padding: 0;
    }
    .slide-visual .image-wrapper {
        min-height: auto;
        padding: 0.5rem;
    }
    .slide-visual img {
        max-width: 90%; 
        max-height: 100px; 
        object-fit: contain; 
    }
    .slider-nav {
        left: 1.5rem;
        right: 1.5rem;
    }
    /* Hide infographic lines on medium screens */
    .simple-steps-grid::before {
        display: none !important;
    }
}
@media (max-width: 576px) { 
    .tools-grid-large.view-grid { grid-template-columns: repeat(2, 1fr); } 
    .tools-grid-large.view-list { grid-template-columns: 1fr; } 
    .tools-grid { 
        grid-template-columns: 1fr; 
    }
    .simple-steps-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }

    .section-title { font-size: 1.25rem; }
    .slider-container {
        padding: 1rem 0.75rem;
    }
    .slide {
        padding: 1rem 0.5rem;
    }
    .slider-nav {
        left: 0.75rem;
        right: 0.75rem;
    }
    /* NEW: Apply specific margin for highlighted section on small screens */
    .support-us-section.highlighted {
        margin: 1rem; 
    }
}