/* 
 * UI Style - AI Social Tools Hub
 * Dark Mode + Glassmorphism + Gradients
 */

:root {
    --asth-bg-dark: #0f172a;
    --asth-bg-card: #1e293b;
    --asth-text-primary: #f8fafc;
    --asth-text-secondary: #94a3b8;
    --asth-primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --asth-accent-blue: #3b82f6;
    --asth-border-color: rgba(255, 255, 255, 0.1);
    --asth-glass-bg: rgba(30, 41, 59, 0.7);
    --asth-radius: 16px;
    --asth-font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset Scope */
.asth-wrapper {
    font-family: var(--asth-font);
    background-color: var(--asth-bg-dark);
    color: var(--asth-text-primary);
    line-height: 1.6;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Ensure it takes full width of container */
    overflow-x: hidden;
}

.asth-wrapper *,
.asth-wrapper *::before,
.asth-wrapper *::after {
    box-sizing: border-box;
}

/* Container */
.asth-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 
 * 1. Header (Sticky & Glass) 
 */
.asth-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--asth-border-color);
    padding: 15px 0;
}

.asth-header .asth-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.asth-logo-icon {
    font-size: 1.5rem;
}

.asth-nav {
    display: none;
    /* Mobile first hidden */
}

@media (min-width: 768px) {
    .asth-nav {
        display: flex;
        gap: 20px;
    }
}

.asth-nav-link {
    color: var(--asth-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.asth-nav-link:hover {
    color: #fff;
}

/* 
 * 2. Hero Section 
 */
.asth-hero {
    padding: 80px 0 60px;
    text-align: center;
    background: radial-gradient(circle at top center, rgba(139, 92, 246, 0.15), transparent 70%);
}

.asth-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #fff;
}

.asth-text-gradient {
    background: var(--asth-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.asth-hero-subtitle {
    font-size: 1.1rem;
    color: var(--asth-text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Wrapper */
.asth-search-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
    align-items: center;
    /* Ensure vertical alignment */
}

.asth-search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.asth-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    font-size: 1.1rem;
    z-index: 10;
    pointer-events: none;
}

#asth-search-input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border-radius: 50px;
    background: rgba(30, 41, 59, 0.6);
    /* Slightly more transparent */
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    /* Prepare for gradient border */
    background-image: linear-gradient(var(--asth-bg-card), var(--asth-bg-card)), var(--asth-primary-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

#asth-search-input:focus {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

#asth-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.asth-filter-box {
    position: relative;
    display: flex;
    /* Helps centering */
}

/* Custom styled Select */
.asth-filter-box select {
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 12px 40px 20px 25px;
    /* Adjusted to move text higher */
    border-radius: 50px;
    background: var(--asth-primary-gradient);
    /* Nicer gradient color */
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    line-height: normal;
    /* Fix alignment issues */
    vertical-align: middle;
}

.asth-filter-box::after {
    content: '▼';
    font-size: 0.8rem;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.asth-filter-box select:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

.asth-filter-box select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Dark option styling for when dropdown opens */
.asth-filter-box select option {
    background: var(--asth-bg-card);
    color: white;
    padding: 10px;
}

/* 
 * 3. Main Grid Sections 
 */
.asth-main {
    padding-bottom: 80px;
}

.asth-category-section {
    margin-bottom: 60px;
}

.asth-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--asth-border-color);
    padding-bottom: 10px;
}

.asth-section-icon {
    font-size: 1.8rem;
}

.asth-section-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff !important;
    /* Force white text */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Grid Layout */
.asth-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 col */
    gap: 20px;
}

@media (min-width: 600px) {
    .asth-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet: 2 cols */
    }
}

@media (min-width: 1024px) {
    .asth-tools-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Desktop: 4 cols */
    }
}

/* 
 * 4. Cards 
 */
.asth-card {
    background: var(--asth-glass-bg);
    border: 1px solid var(--asth-border-color);
    border-radius: var(--asth-radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Force square aspect ratio */
    aspect-ratio: 1 / 1;
}

/* Hover Light Effect */
.asth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 60%);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.asth-card:hover::before {
    transform: rotate(45deg) translateY(0);
}

.asth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 0 10px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.asth-card-content {
    flex-grow: 1;
    margin-bottom: 20px;
}

.asth-card-title {
    font-size: 1.1rem;
    /* Reduced font size as requested */
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #ffffff !important;
    /* Pure white */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    /* Pop against background */
}

.asth-card-desc {
    font-size: 0.95rem;
    color: #f1f5f9;
    /* Lighter text for better visibility */
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asth-card-footer {
    position: relative;
    z-index: 2;
}

.asth-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--asth-primary-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.asth-btn-primary:hover {
    opacity: 0.9;
}

.asth-arrow {
    transition: transform 0.3s;
}

.asth-btn-primary:hover .asth-arrow {
    transform: translateX(4px);
}

/* Card Glow Effect - Subtle overlay based on category color */
.asth-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    /* Top border strip */
    /* Handled by Tailwind classes in PHP or custom classes below */
}

/* Tailwind-ish Gradient Helpers if used directly in class names, 
   but mapped here to CSS variables or classes for simplicity/robustness without actual Tailwind */
.from-blue-600.to-blue-800 {
    background: linear-gradient(to right, #2563eb, #1e40af);
}

.from-purple-500.to-pink-500 {
    background: linear-gradient(to right, #a855f7, #ec4899);
}

.from-gray-700.to-black {
    background: linear-gradient(to right, #374151, #000);
}

.from-red-600.to-red-800 {
    background: linear-gradient(to right, #dc2626, #991b1b);
}

.from-blue-700.to-blue-900 {
    background: linear-gradient(to right, #1d4ed8, #1e3a8a);
}


/* 
 * 5. Utility / Footer 
 */
.asth-no-results {
    text-align: center;
    padding: 40px;
    color: var(--asth-text-secondary);
    font-size: 1.1rem;
}

.asth-btn-secondary {
    background: transparent;
    border: 1px solid var(--asth-text-secondary);
    color: var(--asth-text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

.asth-footer {
    border-top: 1px solid var(--asth-border-color);
    padding: 40px 0;
    text-align: center;
    color: var(--asth-text-secondary);
    font-size: 0.9rem;
}

/* Mobile Responsive Safeguards for Buttons */
.asth-load-more-wrapper,
.asth-show-less-wrapper {
    padding: 0 20px;
    max-width: 100%;
}

.asth-load-more-wrapper button,
.asth-show-less-wrapper button {
    max-width: 100%;
    /* Prevent overflow on tiny screens */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}