/**
 * Homepage Styles
 * AI Finder Guru - Index page specific styles
 */

/* ============================================
   CUSTOM BACKGROUND
   ============================================ */
.custom-background {
    /* background-color: #e4f6f9; */
    min-height: 100vh;
}

/* ============================================
   AUTO-TYPED TEXT STYLES
   ============================================ */
.auto-typed-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0.8rem 0 0.5rem 0;
    min-height: 2rem;
}

.typed-cursor {
    color: #007bff;
}

/* ============================================
   FILTER SECTION STYLES
   ============================================ */
.filter-part {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    backdrop-filter: blur(5px);
}

/* Voice Search Button */
#start-record-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
}

#start-record-btn > div {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007bff;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
    transition: all 0.3s ease;
}

#start-record-btn:hover > div {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.8);
}

/* Voice Recording Animation */
@keyframes wave {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

#recording-status {
    color: #666;
    font-style: italic;
    margin: 0;
}

#voice-search-result {
    font-weight: 600;
    color: #333;
}

/* ============================================
   FORM INPUT STYLES
   ============================================ */
.textarea,
.date-input,
.select-input {
    height: 80px !important;
    background-color: #eeeeee;
    color: #666666;
    border-radius: 8px;
    border: 2px solid #ccc;
    outline: none;
    font-size: 17px;
    font-weight: 500;
    resize: none;
    font-family: 'Heebo', sans-serif;
    transition: all 0.2s ease;
}

.textarea,
.date-input {
    padding: 1rem;
}

.date-input,
.select-input {
    height: 40px !important;
}

.textarea:hover,
.date-input:hover,
.select-input:hover {
    cursor: pointer;
    background-color: white;
}

.textarea:focus,
.date-input:focus,
.select-input:focus {
    cursor: text;
    color: black;
    border-color: black;
}

/* Custom Checkbox */
.checkbox-wrapper-19 {
    box-sizing: border-box;
    --background-color: #fff;
    --checkbox-height: 25px;
}

.checkbox-wrapper-19 input[type=checkbox] {
    display: none;
}

.checkbox-wrapper-19 .check-box {
    height: var(--checkbox-height);
    width: var(--checkbox-height);
    background-color: transparent;
    border: calc(var(--checkbox-height) * .1) solid #000;
    border-radius: 5px;
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    transition: border-color ease 0.2s;
    cursor: pointer;
}

.checkbox-wrapper-19 .check-box::before,
.checkbox-wrapper-19 .check-box::after {
    box-sizing: border-box;
    position: absolute;
    height: 0;
    width: calc(var(--checkbox-height) * .2);
    background-color: #34b93d;
    display: inline-block;
    transform-origin: left top;
    border-radius: 5px;
    content: " ";
    transition: opacity ease 0.5;
}

.checkbox-wrapper-19 .check-box::before {
    top: calc(var(--checkbox-height) * .72);
    left: calc(var(--checkbox-height) * .41);
    box-shadow: 0 0 0 calc(var(--checkbox-height) * .05) var(--background-color);
    transform: rotate(-135deg);
}

.checkbox-wrapper-19 .check-box::after {
    top: calc(var(--checkbox-height) * .37);
    left: calc(var(--checkbox-height) * .05);
    transform: rotate(-45deg);
}

.checkbox-wrapper-19 input[type=checkbox]:checked + .check-box {
    border-color: #34b93d;
}

.checkbox-wrapper-19 input[type=checkbox]:checked + .check-box::after {
    height: calc(var(--checkbox-height) / 2);
    animation: dothabottomcheck-19 0.2s ease 0s forwards;
}

.checkbox-wrapper-19 input[type=checkbox]:checked + .check-box::before {
    height: calc(var(--checkbox-height) * 1.2);
    animation: dothatopcheck-19 0.4s ease 0s forwards;
}

@keyframes dothabottomcheck-19 {
    0% { height: 0; }
    100% { height: calc(var(--checkbox-height) / 2); }
}

@keyframes dothatopcheck-19 {
    0% { height: 0; }
    50% { height: 0; }
    100% { height: calc(var(--checkbox-height) * 1.2); }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
#loading-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#loading-video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    display: none;
}

.spinner {
    width: 300px;
    height: 300px;
    border: 25px solid lightblue;
    border-top: 25px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading Indicator */
#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 5px;
    z-index: 1000;
}

/* ============================================
   TOOLS COUNT CONTAINER
   ============================================ */
.tools-count-container {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: pulse 1s ease-in-out infinite;
}

.tools-count {
    color: #d9534f;
    font-size: 32px;
    font-weight: 900;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .tools-count-container {
        font-size: 18px;
        padding: 10px;
    }
    .tools-count {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .tools-count-container {
        font-size: 14px;
        padding: 6px;
    }
    .tools-count {
        font-size: 28px;
    }
}

/* ============================================
   NEWS CAROUSEL STYLES
   ============================================ */
.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    height: 320px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(5px);
}

.carousel-content {
    display: flex;
    animation: scroll 40s linear infinite;
}

.news-card-pair {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-400%); }
}

.carousel-container:hover .carousel-content {
    animation-play-state: paused;
}

/* Placeholder animations */
.placeholder-image {
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px 0 0 8px;
}

.placeholder-title {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent;
    border-radius: 4px;
    height: 20px;
}

.placeholder-meta {
    background: linear-gradient(90deg, #f8f8f8 25%, #e8e8e8 50%, #f8f8f8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent !important;
    border-radius: 4px;
    height: 14px;
    width: 70%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.carousel-fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Carousel status */
#carousel-status {
    font-size: 0.7em;
    color: #6c757d;
}

/* ============================================
   CATEGORIES & TAGS SCROLL
   ============================================ */
.cylindrical-scroll {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100px;
}

.scroll-row {
    display: flex;
    gap: 2px;
    justify-content: space-between;
    white-space: nowrap;
    margin-bottom: 3px;
}

.scroll-row svg {
    margin-right: 5px;
}

@keyframes scroll-horizontal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

#categories-scroll .scroll-row,
#tags-scroll .scroll-row {
    animation: scroll-horizontal 20s linear infinite;
}

#categories-scroll:hover .scroll-row,
#tags-scroll:hover .scroll-row {
    animation-play-state: paused;
}

.frontpage-tags {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #000;
    background-color: #f7e0db;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.frontpage-tags:hover {
    background-color: #f0d0c9;
    text-decoration: none;
}

.category-button {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 5px;
    cursor: pointer;
}

.continuous-row-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================================
   FAQ SECTION STYLES
   ============================================ */
.ai-finder-guru-faq {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    margin-top: 150px;
}

.ai-finder-guru-faq .faq-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.ai-finder-guru-faq h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.ai-finder-guru-faq .faq-item {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.ai-finder-guru-faq .faq-title {
    cursor: pointer;
    padding: 15px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.ai-finder-guru-faq .faq-title:hover {
    background-color: #f0f0f0;
}

.ai-finder-guru-faq .faq-title span {
    font-weight: bold;
    color: #2c3e50;
}

.ai-finder-guru-faq .faq-content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 20px;
}

.ai-finder-guru-faq .faq-content.active {
    padding: 15px;
    max-height: 1000px;
}

.ai-finder-guru-faq .icon {
    transition: transform 0.3s ease;
}

.ai-finder-guru-faq .icon.active {
    transform: rotate(180deg);
}

/* ============================================
   JUMP TO PAGE FORM
   ============================================ */
.jump-to-page {
    margin: 20px 0;
}

#jump-to-page-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

#page-number-input {
    width: 300px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

@media (max-width: 800px) {
    #page-number-input {
        width: 100px;
    }
}

@media (max-width: 576px) {
    #page-number-input {
        width: 100px;
    }
}

/* ============================================
   ALL TOOLS SECTION
   ============================================ */
.wrapper {
    padding: 2rem 0;
}

.container-fostrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.heading {
    text-align: center;
    font-weight: bold;
    margin-bottom: 2rem;
    color: #333;
}

#tools-container {
    margin-bottom: 2rem;
}

#pagination-container {
    margin-top: 1rem;
}

/* ============================================
   TRENDING ARTICLES SECTION
   ============================================ */
.trending-articles-section {
    padding: 10px 0;
}

.trending-articles-section .section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.trending-articles-section .article-card {
    max-height: 90px;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.trending-articles-section .card-image-link {
    flex: 0 0 80px;
    display: block;
}

.trending-articles-section .card-image-link img,
.trending-articles-section .article-image {
    width: 80px;
    height: 90px;
    object-fit: cover;
}

.trending-articles-section .card-body {
    padding: 8px 10px !important;
}

.trending-articles-section .card-title {
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.trending-articles-section .card-title a {
    color: #333;
    text-decoration: none;
}

.trending-articles-section .article-meta {
    font-size: 0.7rem;
    color: #888;
}

.trending-articles-section .article-excerpt {
    font-size: 0.75rem;
    line-height: 1.3;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dark Mode */
body.dark-mode .trending-articles-section .section-title {
    color: #f1f5f9;
}

body.dark-mode .trending-articles-section .card-title a {
    color: #f1f5f9;
}

body.dark-mode .trending-articles-section .article-excerpt {
    color: #94a3b8;
}

body.dark-mode .trending-articles-section .article-card {
    background: #1e293b;
    border-color: #334155;
}

.card-image-link {
    flex: 0 0 100px;
    display: block;
}

.card-image-link img {
    width: 100px;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   FULL-WIDTH LAYOUT OVERRIDES
   ============================================ */
/* Override Bootstrap container max-width for full-width layout */
.custom-background .container {
    max-width: 100%;
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    .custom-background .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .auto-typed-text {
        font-size: 0.95rem;
    }
    
    .ai-finder-guru-faq {
        margin-top: 80px;
        padding: 10px;
    }
    
    .ai-finder-guru-faq .faq-content {
        font-size: 16px;
    }
}

/* Dark Mode for Typed Text */
body.dark-mode .auto-typed-text {
    color: #f1f5f9;
}

body.dark-mode .typed-cursor {
    color: #60a5fa;
}

@media (max-width: 540px) {
    .filter-part {
        padding: 10px;
        margin: 5px 0;
    }
    
    .carousel-container {
        height: 280px;
        padding: 10px;
    }
}

/* ============================================
   NEWSLETTER SUBSCRIPTION SECTION
   ============================================ */
.newsletter-section {
    padding: 1rem 1rem 2rem 1rem;
    margin: 0 auto;
    max-width: 1200px;
}

.newsletter-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.newsletter-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 280px;
    position: relative;
    z-index: 1;
}

.newsletter-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.newsletter-text h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    border: none;
}

.newsletter-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-width: 300px;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.newsletter-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #333;
    outline: none;
    min-width: 0;
}

.newsletter-input-group input::placeholder {
    color: #999;
}

.newsletter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
}

.newsletter-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.newsletter-btn:active {
    transform: scale(0.98);
}

.newsletter-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-message {
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2rem;
    color: white;
    font-weight: 500;
}

.newsletter-message.error {
    color: #ffd5d5;
}

.newsletter-message.success {
    color: #d5ffd5;
}

/* Responsive */
@media (max-width: 768px) {
    .newsletter-container {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        width: 100%;
        max-width: 100%;
    }
    
    .newsletter-input-group {
        flex-direction: column;
        border-radius: 12px;
        padding: 0;
        gap: 0;
    }
    
    .newsletter-input-group input {
        border-radius: 12px 12px 0 0;
        padding: 1rem;
        text-align: center;
    }
    
    .newsletter-btn {
        border-radius: 0 0 12px 12px;
        padding: 1rem;
        width: 100%;
    }
}

/* Dark Mode */
body.dark-mode .newsletter-container {
    background: linear-gradient(135deg, #4c5c9e 0%, #5a3f7a 100%);
}

body.dark-mode .newsletter-input-group {
    background: #1e293b;
}

body.dark-mode .newsletter-input-group input {
    color: #f1f5f9;
}

body.dark-mode .newsletter-input-group input::placeholder {
    color: #64748b;
}

/* ============================================
   MOBILE FIXES - NEWSLETTER & TRENDING ARTICLES
   ============================================ */
@media (max-width: 576px) {
    /* Newsletter mobile fixes */
    .newsletter-section {
        padding: 1rem 0.5rem;
    }
    
    .newsletter-container {
        padding: 1.25rem;
    }
    
    .newsletter-text h3 {
        font-size: 1.1rem;
    }
    
    .newsletter-text p {
        font-size: 0.85rem;
    }
    
    .newsletter-input-group {
        flex-direction: column;
        border-radius: 12px;
        padding: 0;
        gap: 0;
        background: white;
    }
    
    .newsletter-input-group input {
        border-radius: 12px 12px 0 0;
        padding: 0.9rem 1rem;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    .newsletter-btn {
        border-radius: 0 0 12px 12px;
        padding: 0.9rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Trending articles mobile fixes - show card body */
    .trending-articles-section .article-card {
        flex-direction: column !important;
        max-height: none;
        height: auto;
    }
    
    .trending-articles-section .card-image-link {
        flex: none;
        width: 100%;
    }
    
    .trending-articles-section .card-image-link img,
    .trending-articles-section .article-image {
        width: 100%;
        height: 120px;
        object-fit: cover;
        border-radius: 6px 6px 0 0;
    }
    
    .trending-articles-section .card-body {
        padding: 10px 12px !important;
        display: flex !important;
        flex-direction: column;
    }
    
    .trending-articles-section .card-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .trending-articles-section .article-meta {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .trending-articles-section .article-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}
