/* ===================================
   Read+ Landing Page Styles
   Modern, Clean, and Responsive Design
   =================================== */

/* CSS Variables - Design System */
:root {
    /* Colors - Book & Knowledge Inspired */
    --color-background: hsl(45, 23%, 97%);
    --color-foreground: hsl(220, 27%, 18%);
    --color-primary: hsl(220, 91%, 32%);
    --color-primary-light: hsl(220, 91%, 52%);
    --color-secondary: hsl(24, 95%, 53%);
    --color-secondary-light: hsl(24, 95%, 63%);
    --color-muted: hsl(45, 23%, 95%);
    --color-muted-foreground: hsl(220, 13%, 46%);
    --color-accent: hsl(262, 73%, 57%);
    --color-border: hsl(220, 13%, 91%);
    --color-white: hsl(0, 0%, 100%);
    
    /* Shadows */
    --shadow-soft: 0 4px 20px -4px hsla(220, 91%, 32%, 0.1);
    --shadow-feature: 0 8px 30px -8px hsla(220, 91%, 32%, 0.15);
    --shadow-hero: 0 20px 60px -12px hsla(220, 91%, 32%, 0.25);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===================================
   Reset & Base Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-foreground);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===================================
   Container & Layout
   =================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
}

/* ===================================
   Hero Section
   =================================== */

.hero-section {
    position: relative;
    padding: var(--spacing-lg) 0;
    background: linear-gradient(180deg, var(--color-background), var(--color-muted));
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-section {
        padding: var(--spacing-xl) 0;
    }
}

.hero-content {
    display: grid;
    gap: var(--spacing-xl);
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-section {
        padding: 2.5rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
}

.hero-text {
    text-align: center;
}

@media (min-width: 1024px) {
    .hero-text {
        text-align: left;
    }
}

.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

@media (min-width: 1024px) {
    .logo-header {
        justify-content: flex-start;
    }
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: var(--spacing-sm);
}

@media (min-width: 768px) {
    .logo-icon {
        width: 3rem;
        height: 3rem;
    }
}

.logo-text {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-foreground);
    line-height: 1;
}

@media (min-width: 768px) {
    .logo-text {
        font-size: var(--font-size-4xl);
    }
}

@media (min-width: 1024px) {
    .logo-text {
        font-size: var(--font-size-5xl);
    }
}

.logo-plus {
    color: var(--color-primary);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: var(--font-size-xl);
    }
}

@media (min-width: 1024px) {
    .hero-subtitle {
        font-size: var(--font-size-2xl);
    }
}

.hero-description {
    font-size: var(--font-size-sm);
    color: var(--color-muted-foreground);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    max-width: 42rem;
}

@media (min-width: 768px) {
    .hero-description {
        font-size: var(--font-size-base);
    }
}

@media (min-width: 1024px) {
    .hero-description {
        font-size: var(--font-size-lg);
    }
}

.hero-image {
    position: relative;
}

.hero-img {
    width: 100%;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-hero);
}

/* ===================================
   Buttons
   =================================== */

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
    margin-bottom: var(--spacing-sm);
    width: 100%;
    max-width: 280px;
}

@media (min-width: 640px) {
    .btn-primary,
    .btn-secondary {
        width: auto;
        padding: 1rem 2rem;
        font-size: var(--font-size-lg);
    }
}

@media (min-width: 768px) {
    .btn-primary,
    .btn-secondary {
        padding: 1rem 2.5rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hero);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-white);
    box-shadow: var(--shadow-feature);
}

.btn-secondary:hover {
    background: var(--color-secondary-light);
    transform: scale(1.05);
    box-shadow: var(--shadow-hero);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.availability-text {
    font-size: var(--font-size-sm);
    color: var(--color-muted-foreground);
}

/* ===================================
   Features Section
   =================================== */

.features-section {
    padding: var(--spacing-2xl) 0;
    background-color: var(--color-muted);
}

@media (min-width: 768px) {
    .features-section {
        padding: var(--spacing-3xl) 0;
    }
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .section-title {
        font-size: var(--font-size-4xl);
    }
}

@media (min-width: 1024px) {
    .section-title {
        font-size: var(--font-size-5xl);
    }
}

.section-description {
    font-size: var(--font-size-base);
    color: var(--color-muted-foreground);
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.7;
}

@media (min-width: 768px) {
    .section-description {
        font-size: var(--font-size-lg);
    }
}

@media (min-width: 1024px) {
    .section-description {
        font-size: var(--font-size-xl);
    }
}

.features-grid {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    position: relative;
    background: var(--color-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.feature-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: var(--shadow-feature);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-bounce);
}

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

.feature-icon svg {
    color: var(--color-white);
}

.feature-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: var(--spacing-sm);
}

.feature-description {
    font-size: var(--font-size-base);
    color: var(--color-muted-foreground);
    line-height: 1.6;
}

/* ===================================
   CTA Section
   =================================== */

.cta-section {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--color-muted), var(--color-background));
}

@media (min-width: 768px) {
    .cta-section {
        padding: var(--spacing-3xl) 0;
    }
}

.cta-content {
    text-align: center;
}

.cta-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .cta-title {
        font-size: var(--font-size-4xl);
    }
}

@media (min-width: 1024px) {
    .cta-title {
        font-size: var(--font-size-5xl);
    }
}

.cta-description {
    font-size: var(--font-size-base);
    color: var(--color-muted-foreground);
    max-width: 42rem;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.7;
}

@media (min-width: 768px) {
    .cta-description {
        font-size: var(--font-size-lg);
    }
}

@media (min-width: 1024px) {
    .cta-description {
        font-size: var(--font-size-xl);
    }
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 640px) {
    .cta-buttons {
        flex-direction: row;
        gap: var(--spacing-md);
    }
}

.cta-footer-text {
    color: var(--color-muted-foreground);
}

.cta-footer-text strong {
    color: var(--color-foreground);
}

/* ===================================
   Footer
   =================================== */

.footer {
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-background);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-brand {
    text-align: center;
}

@media (min-width: 768px) {
    .footer-brand {
        text-align: left;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xs);
}

@media (min-width: 768px) {
    .footer-logo {
        justify-content: flex-start;
    }
}

.footer-logo-icon {
    width: 2rem;
    height: 2rem;
    margin-right: var(--spacing-xs);
}

.footer-logo-text {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-foreground);
}

.footer-copyright {
    font-size: var(--font-size-sm);
    color: var(--color-muted-foreground);
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-link {
    font-size: var(--font-size-sm);
    color: var(--color-muted-foreground);
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--color-primary);
}

/* ===================================
   Carousel
   =================================== */

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-hero);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 1rem 0; /* Add vertical padding */
    padding-bottom: calc(140% + 2rem); /* Aspect ratio for mobile screenshots (vertical) - reduced 30% + padding */
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

@media (min-width: 768px) {
    .carousel-wrapper {
        padding-bottom: calc(126% + 2rem); /* Adjust for tablets - reduced 30% + padding */
    }
}

@media (min-width: 1024px) {
    .carousel-wrapper {
        padding-bottom: calc(112% + 2rem); /* Adjust for desktops - reduced 30% + padding */
    }
}

.carousel-track {
    position: absolute;
    top: 1rem;
    left: 0;
    width: 100%;
    height: calc(100% - 2rem);
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 58, 138, 0.2);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.carousel-btn:hover {
    background: var(--color-white);
    border-color: rgba(30, 58, 138, 0.35);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-feature);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-primary);
}

.carousel-btn-prev {
    left: 1rem;
}

.carousel-btn-next {
    right: 1rem;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    padding: 0;
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background: var(--color-white);
    width: 1.5rem;
    border-radius: 0.25rem;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .carousel-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .carousel-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .carousel-btn-prev {
        left: 0.5rem;
    }
    
    .carousel-btn-next {
        right: 0.5rem;
    }
    
    .carousel-indicators {
        bottom: 1rem;
    }
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===================================
   Utility Classes
   =================================== */

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

/* RTL helpers */
[dir="rtl"] .rtl-row-reverse { flex-direction: row-reverse; }
[dir="rtl"] .rtl-flip { text-align: right; }
