/* =============================
   Clock7 Calculators Portal - IMPROVED LAYOUT V1.3
   ============================= */

/* LOCK FOOTER GAP */
#calculator-hub { 
    padding-bottom: 0 !important; 
}
.calculator-hub-container { 
    margin-bottom: 0 !important; 
}

/* HERO SECTION */
.calc-hero { 
    margin-bottom: 30px; 
    padding: 10px 0; /* Add a bit of vertical padding */
}
.calc-hero .hub-title {
    font-size: 2.2rem; /* Slightly larger title */
    color: #1f2937;
    margin-bottom: 10px;
}
.calc-hero .hub-subtitle { 
    font-size: 1.05rem; 
    color: #4b5563; /* Darker subtle text */
    max-width: 700px;
    margin: 0 auto;
}
/* Highlight keywords in subtitle */
.calc-hero .hub-subtitle strong {
    color: #22c55e;
    font-weight: 700;
}


/* SEARCH + SORT BAR WRAPPER */
.calc-controls-wrapper {
    margin-bottom: 30px;
    padding: 15px;
    background: #f9fafb; /* Light background for the control bar */
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.calc-controls {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 15px;
    align-items: center;
}

/* SEARCH FIELD IMPROVED */
#toolSearch {
    flex: 1 1 60%; /* Takes up majority of space */
    padding: 14px 20px;
    border-radius: 999px;
    border: 2px solid #e5e7eb; /* Thicker border */
    font-size: 1rem;
    transition: all .2s ease;
    min-width: 200px; /* Ensure minimum width on small devices */
}
#toolSearch:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); /* Stronger focus shadow */
}

/* SORT CONTROLS */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Prevents shrinking */
}
.sort-controls label {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
    display: none; /* Hide label on desktop to save space, relies on select label */
}
#sortTools {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: .95rem;
    cursor: pointer;
    background-color: #fff;
    -webkit-appearance: none; /* Removes default dropdown arrow in Chrome/Safari */
    -moz-appearance: none; /* Removes default dropdown arrow in Firefox */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231f2937'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.956l3.71-3.726a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1.2em;
    padding-right: 30px; /* Make space for the custom arrow */
}


/* GRID LAYOUT */
.calc-grid {
    display: grid;
    /* 3 columns max on desktop, adapting nicely down to mobile */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 20px;
    margin-top: 18px;
}

/* CARD STYLES */
.calc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 18px; /* Slightly larger radius */
    text-decoration: none;
    transition: all .2s ease;
    display: block; /* Ensure search displays correctly */
}
.calc-card:hover {
    transform: translateY(-4px); /* More noticeable lift */
    border-color: #22c55e;
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.15); /* Green-focused shadow */
}
.calc-card h3 {
    font-size: 1rem; /* Slightly larger title font */
    font-weight: 700;
    margin-bottom: 10px;
    color:#111827;
}
.calc-cat {
    font-size: .75rem; /* Clearer category font */
    padding: 5px 12px;
    border-radius: 999px;
    background:#e6fffa; /* Light cyan/teal background */
    color:#008080; /* Teal text */
    font-weight: 600;
    display: inline-block; /* Essential for padding/margin to work */
}

/* SEO Content Styles */
.seo-content {
    padding-top: 40px;
}
.seo-content h2 {
    font-size: 1.75rem;
    color: #1f2937;
    margin-bottom: 15px;
}
.seo-content h3 {
    font-size: 1.35rem;
    color: #22c55e;
    margin-top: 25px;
    margin-bottom: 10px;
}
.seo-content ul {
    list-style-type: disc;
    margin-left: 20px;
    padding-left: 0;
    margin-bottom: 20px;
    color: #4b5563;
}
.seo-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}
.seo-content p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 15px;
}


/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .calc-hero .hub-title {
        font-size: 1.8rem;
    }
    .calc-hero .hub-subtitle {
        font-size: 1rem;
    }
    
    /* Control bar stacking on small screens */
    .calc-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }
    .sort-controls label {
        display: block; /* Show label on mobile for clarity */
    }
    #toolSearch {
        flex-basis: 100%; /* Full width search bar */
    }
    #sortTools {
        flex: 1; /* Take up remaining space next to label */
    }

    /* Grid adaptation */
    .calc-grid { 
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Force one column on smaller phones */
        gap: 15px;
    }
    .calc-card {
        padding: 16px;
    }
    .calc-card:hover {
        transform: none; /* Reduce hover effect on touch devices */
        box-shadow: 0 4px 15px rgba(0,0,0,.1);
    }
    .calc-card h3 {
        font-size: 0.95rem;
    }
    .calc-cat {
        font-size: 0.7rem;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    /* Allow two columns for slightly larger phones/portrait tablets */
    .calc-grid { 
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); 
    }
}