/**
 * Professional Homepage Styles for SpeedRead Theme
 * Modern design with enhanced user experience
 */

/* Global Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Universal Cards Grid System */
.universal-cards-grid {
    display: grid;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.universal-cards-grid.cols-6 {
    grid-template-columns: repeat(5, 1fr);
}

.universal-cards-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.universal-cards-grid.cols-4 {
    grid-template-columns: repeat(5, 1fr);
}

.universal-cards-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.universal-cards-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
    .universal-cards-grid.cols-6,
    .universal-cards-grid.cols-5,
    .universal-cards-grid.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .universal-cards-grid.cols-6,
    .universal-cards-grid.cols-5,
    .universal-cards-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .universal-cards-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .universal-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Hero Subtitle Custom Color */
.hero-subtitle-colored {
    color: #ffe066; /* Modern gold, readable on dark backgrounds */
    font-weight: 500;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 16px rgba(0,0,0,0.12);
    transition: color 0.3s;
}

/* CTA Subtitle Custom Color */
.cta-subtitle-colored {
    color: #ffe066; /* Modern gold, matches hero subtitle */
    font-weight: 500;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.10);
    transition: color 0.3s;
}

/* Hero Section */
.homepage-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 120px 120px;
    animation: float 20s ease-in-out infinite;
}

.hero-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
}

.hero-text {
    margin-bottom: 3rem;
}

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

.hero-title-main {
    display: block;
    color: #ffffff;
}

.hero-title-accent {
    display: block;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #fbbf24);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.3rem;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Enhanced Search Box */
.hero-search {
    margin-bottom: 3rem;
}

.search-form-hero {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    background: rgba(255,255,255,0.95);
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.search-input-hero {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    color: #1f2937;
    min-width: 0;
}

.search-input-hero::placeholder {
    color: #6b7280;
}

.search-btn-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.search-btn-hero svg {
    width: 20px;
    height: 20px;
}

/* Hero Statistics */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-stats .stat-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hero-stats .stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.hero-stats .stat-item:hover::before {
  left: 100%;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-sublabel {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Homepage Sections */
.homepage-categories,
.homepage-featured,
.homepage-popular,
.homepage-recent,
.homepage-authors {
    padding: 4rem 0;
    background: #f8fafc;
}

.homepage-featured,
.homepage-recent {
    background: white;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.category-count {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Authors Grid */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.author-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.author-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.author-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-placeholder {
    font-size: 2rem;
    color: white;
}

.author-book-count {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Call to Action Section */
.homepage-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cta-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-btn.primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 20px rgba(255,255,255,0.3);
}

.cta-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.4);
}

.cta-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.cta-btn.secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-3px);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

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

/* Responsive Design - Mobile First Approach */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        padding: 0 3rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
}

/* Tablet Landscape (1024px - 1200px) */
@media (max-width: 1200px) and (min-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .authors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Tablet Portrait (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .search-input-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .search-input-hero {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
    
    .search-btn-hero {
        padding: 1rem 1.5rem;
        min-width: 120px;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .authors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .cta-buttons {
        gap: 1.5rem;
    }
    
    .cta-btn {
        padding: 1rem 2rem;
        min-height: 48px; /* Touch-friendly */
    }
}

/* Mobile Large (480px - 768px) */
@media (max-width: 768px) and (min-width: 480px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 2.4rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .search-input-wrapper {
        flex-direction: row;
        max-width: 450px;
        margin: 0 auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .search-input-hero {
        flex: 1;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .search-btn-hero {
        padding: 0.8rem 1.2rem;
        border-radius: 12px;
        min-width: 100px;
        min-height: 44px; /* Touch-friendly */
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
        min-height: 120px;
    }
    
    .authors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .author-card {
        padding: 1.5rem 1rem;
        min-height: 140px;
    }
    
    .cta-title {
        font-size: 2.2rem;
    }
    
    .cta-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        min-height: 48px; /* Touch-friendly */
        padding: 1rem 2rem;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .homepage-hero {
        min-height: 85vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .hero-title-main,
    .hero-title-accent {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin: 2rem 10px;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
        min-height: 80px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
        border-radius: 20px;
        max-width: 100%;
        width: 95%;
        margin: 0 auto;
    }
    
    .search-input-hero {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 15px;
        width: 100%;
        min-width: 0;
        flex: 1;
    }
    
    .search-btn-hero {
        padding: 1rem 1.5rem;
        border-radius: 15px;
        justify-content: center;
        min-height: 48px; /* Touch-friendly */
        font-size: 1rem;
        white-space: nowrap;
        width: 100%;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .categories-grid,
    .authors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-card,
    .author-card {
        padding: 1.5rem;
        min-height: 100px;
        text-align: center;
    }
    
    .category-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .author-avatar {
        width: 60px;
        height: 60px;
        margin: 0 auto 1rem;
    }
    
    .cta-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .cta-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
        min-height: 50px; /* Touch-friendly */
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }
    
    .homepage-categories,
    .homepage-featured,
    .homepage-popular,
    .homepage-recent,
    .homepage-authors,
    .homepage-cta {
        padding: 2.5rem 0;
    }
    
    /* Fix universal cards grid responsiveness */
    .universal-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .universal-cards-grid.cols-6,
    .universal-cards-grid.cols-5,
    .universal-cards-grid.cols-4,
    .universal-cards-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .container {
        padding: 0 0.8rem;
    }
    
    .universal-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.8rem;
        min-height: 70px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .search-input-wrapper {
        width: 98%;
        padding: 0.8rem;
    }
    
    .search-input-hero {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .search-btn-hero {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .universal-cards-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .category-card,
    .author-card {
        padding: 1rem;
        min-height: 80px;
    }
}
