/**
 * Omnicalculator Style Homepage
 * Hesapla24 - Özel Tasarım
 */

/* Keep header search visible on calculator page - ALL DEVICES */
body.page-template-home-calculator #header .search-menu-item,
body.page-template-home-calculator #header .search-menu-item a,
body.page-template-home-calculator #header .epcl-search-button,
body.page-template-home-calculator .epcl-search-button,
body.page-template-home-calculator .main-nav .search-menu-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop: Always show search icon */
@media (min-width: 769px) {
    body.page-template-home-calculator #header .search-menu-item {
        display: flex !important;
    }
    
    body.page-template-home-calculator #header .main-nav {
        display: flex !important;
    }
    
    body.page-template-home-calculator #header .main-nav .menu {
        display: flex !important;
    }
}

/* Mobile: Show search button */
@media (max-width: 768px) {
    body.page-template-home-calculator .epcl-search-button {
        display: flex !important;
    }
}

/* Ensure header is always visible and sticky */
body.page-template-home-calculator #header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Remove ALL extra spacing from page */
body.page-template-home-calculator #wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-template-home-calculator #home-calculator {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-template-home-calculator .main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-template-home-calculator #content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure no gaps between header and hero */
body.page-template-home-calculator #header + * {
    margin-top: 0 !important;
}

/* ============================================
   Categories Sidebar Menu
   ============================================ */
.calculator-categories-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.calculator-categories-menu.active {
    right: 0;
}

.categories-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px 16px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.categories-menu-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.categories-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #ffffff;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.categories-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.categories-menu-close svg {
    width: 20px;
    height: 20px;
}

.categories-menu-list {
    padding: 5px 0;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.categories-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-menu-list li {
    border-bottom: 1px solid #f3f4f6;
}

.categories-menu-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #1F2937;
    transition: all 0.2s ease;
    font-weight: 500;
}

.categories-menu-list a:hover {
    background: #f9fafb;
    color: #667eea;
}

.category-menu-name {
    font-size: 0.9rem;
}

.category-menu-count {
    background: #e5e7eb;
    color: #6B7280;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.categories-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.categories-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Use existing header menu button for categories */
body.page-template-home-calculator .open-menu {
    z-index: 100;
}

/* Hide default side navigation on calculator page */
body.page-template-home-calculator #side-navigation {
    display: none !important;
}

/* ============================================
   Hero Search Section
   ============================================ */
.hero-search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 20px 100px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

/* Desktop spacing */
@media (min-width: 1024px) {
    .hero-search-section {
        padding: 100px 20px 120px;
    }
}

/* Tablet spacing */
@media (min-width: 769px) and (max-width: 1023px) {
    .hero-search-section {
        padding: 70px 20px 90px;
    }
}

/* Mobile spacing */
@media (max-width: 768px) {
    .hero-search-section {
        padding: 50px 20px 60px;
    }
}

.hero-search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.3;
}



.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    margin-bottom: 0;
}

/* Hero Search Integration */
.hero-search-wrapper {
    margin-top: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search-wrapper .search-form {
    max-width: 100%;
}

.hero-search-wrapper .form-group {
    position: relative;
}

.hero-search-wrapper .search-field {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.hero-search-wrapper .search-field::placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.hero-search-wrapper .search-field:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.hero-search-wrapper .epcl-button.submit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 90px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-search-wrapper .epcl-button.submit:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-50%) scale(1.05);
}

/* Mobile responsive for hero search */
@media (max-width: 768px) {
    .hero-search-wrapper {
        margin-top: 28px;
        padding: 0 20px;
        max-width: 100%;
    }

    .hero-search-wrapper .search-field {
        padding: 16px 18px;
        font-size: 1rem;
    }

    .hero-search-wrapper .search-field::placeholder {
        font-size: 0.95rem;
    }

    .hero-search-wrapper .epcl-button.submit {
        padding: 8px 16px;
        font-size: 0.9rem;
        right: 8px;
    }
}

/* ============================================
   Search Form - EXACT Omnicalculator Style
   ============================================ */
.calculator-search-wrapper {
    margin: 40px auto 0;
    max-width: 800px;
}

.calculator-search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #F3F4F6;
    border-radius: 50px;
    padding: 0 20px;
    box-shadow: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.search-icon {
    display: block;
    color: #667eea;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 0;
    order: 2;
}

.calculator-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 18px 16px 18px 0;
    background: transparent;
    color: #1F2937;
    font-weight: 400;
    order: 1;
}

.calculator-search-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.calculator-search-button {
    display: none;
}

/* Search Suggestions - Omnicalculator Style */
.search-suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.suggestion-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    font-weight: 500;
    margin-right: 6px;
}

.suggestion-tag {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.suggestion-tag:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Categories Section
   ============================================ */
.calculator-categories-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.categories-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    color: #1F2937;
    margin-bottom: 10px;
}

.categories-subtitle {
    text-align: center;
    color: #6B7280;
    font-size: 1.1rem;
    margin-bottom: 50px;
}

.calculator-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Category Cards
   ============================================ */
.category-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-color, #667eea);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--card-color, #667eea);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-color, #667eea);
    border-radius: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon svg {
    color: #ffffff;
    width: 36px;
    height: 36px;
}

.category-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 6px;
}

.category-count {
    font-size: 0.9rem;
    color: #6B7280;
    font-weight: 500;
}

/* ============================================
   Popular Calculators
   ============================================ */
.popular-calculators-section {
    padding: 80px 20px;
    background: #ffffff;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    color: #1F2937;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    color: #6B7280;
    font-size: 1rem;
    margin-bottom: 50px;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Popular Cards
   ============================================ */
.popular-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.popular-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.popular-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.popular-category {
    display: inline-block;
    background: #EEF2FF;
    color: #667eea;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    width: fit-content;
}

.popular-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.popular-title a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-title a:hover {
    color: #667eea;
}

.popular-excerpt {
    color: #6B7280;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.popular-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9CA3AF;
    font-size: 0.85rem;
    font-weight: 500;
}

.popular-meta svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
    .calculator-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 768px) {
    .hero-search-section {
        padding: 40px 16px 50px;
    }
    
    .hero-label {
        font-size: 0.85rem;
        margin-bottom: 12px;
        letter-spacing: 1.5px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    /* Mobile Search - Omnicalculator Style */
    .calculator-search-wrapper {
        max-width: 100%;
        margin-top: 24px;
    }
    
    .search-input-wrapper {
        padding: 0 16px;
        border-radius: 50px;
    }
    
    .search-input-wrapper:focus-within {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    }
    
    .search-icon {
        width: 18px;
        height: 18px;
    }
    
    .calculator-search-input {
        padding: 14px 12px 14px 0;
        font-size: 0.95rem;
    }
    
    .calculator-search-input::placeholder {
        font-size: 0.9rem;
    }
    
    .search-suggestions {
        display: none;
    }
    
    /* Mobile: List view like Omnicalculator */
    .calculator-categories-grid {
        display: block;
        max-width: 100%;
    }
    
    .category-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 16px 20px;
        margin-bottom: 8px;
        border-radius: 12px;
        gap: 16px;
    }
    
    .category-card::before {
        display: none;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .category-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .category-card:hover .category-icon {
        transform: none;
    }
    
    .category-name {
        font-size: 1.05rem;
        margin-bottom: 0;
        flex: 1;
    }
    
    .category-count {
        font-size: 0.85rem;
        margin-left: auto;
    }
    
    .calculator-categories-section {
        padding: 40px 16px;
    }
    
    .categories-title {
        font-size: 1.4rem;
        text-align: left;
        padding: 0 4px;
        margin-bottom: 20px;
    }
    
    .categories-subtitle {
        display: none;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        display: none;
    }
    
    .popular-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-search-section {
        padding: 30px 12px 40px;
    }
    
    .hero-label {
        font-size: 0.75rem;
        margin-bottom: 10px;
        letter-spacing: 1px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .calculator-search-wrapper {
        margin-top: 20px;
    }
    
    .search-input-wrapper {
        padding: 0 14px;
    }
    
    .search-icon {
        width: 16px;
        height: 16px;
    }
    
    .calculator-search-input {
        padding: 12px 10px 12px 0;
        font-size: 0.9rem;
    }
    
    .calculator-categories-section {
        padding: 30px 12px;
    }
    
    .categories-title {
        font-size: 1.3rem;
        padding: 0 8px;
        margin-bottom: 16px;
    }
    
    .calculator-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 14px 16px;
        margin-bottom: 6px;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
    }
    
    .category-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .category-name {
        font-size: 1rem;
    }
    
    .category-count {
        font-size: 0.8rem;
    }
    
    .search-suggestions {
        flex-direction: column;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card,
.popular-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.15s; }
.category-card:nth-child(4) { animation-delay: 0.2s; }
.category-card:nth-child(5) { animation-delay: 0.25s; }
.category-card:nth-child(6) { animation-delay: 0.3s; }
.category-card:nth-child(7) { animation-delay: 0.35s; }
.category-card:nth-child(8) { animation-delay: 0.4s; }
.category-card:nth-child(9) { animation-delay: 0.45s; }
.category-card:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   Footer - Responsive & Always Visible
   ============================================ */
body.page-template-home-calculator #footer,
body.page-template-home-calculator footer {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Footer should be responsive */
@media (max-width: 768px) {
    body.page-template-home-calculator #footer .grid-container,
    body.page-template-home-calculator footer .grid-container {
        padding: 20px;
    }
}

