/* 
 * Storyteller - Main Stylesheet
 * A whimsical, child-friendly design with Bodoni 72 font
 */

/* ===== Base Styles ===== */
:root {
    /* Main color palette */
    --primary: #7e57c2;
    --primary-light: #b39ddb;
    --primary-dark: #4527a0;
    --secondary: #ff7aa2;
    --secondary-light: #ffb2cc;
    --secondary-dark: #2D413C;
    --accent: #64b5f6;
    --text-dark: #3a3a3a;
    --text-medium: #666666;
    --text-light: #888888;
    --background: #ffffff;
    --background-light: #FEFBED;
    --success: #66bb6a;
    --error: #e53935;
    --warning: #ffa726;
    --info: #29b6f6;
    
    /* Typography */
    --heading-font: 'bodoni-72', Georgia, serif;
    --body-font: Nunito, serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-circle: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.15);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--background);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

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

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

/* ===== Header & Navigation ===== */
header {
    background-color: var(--background);
    padding: var(--spacing-md) 0;

    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--primary-dark);
}

.logo img {
    height: 100px;
    margin-right: var(--spacing-sm);
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-dark);
}

nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

nav a {
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--radius-md);
}

nav a:hover {
    background-color: var(--background-light);
    text-decoration: none;
}

nav a.active {
    color: var(--primary-dark);
    font-weight: 600;
}

.logo a:hover {
    text-decoration: none;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    font-family: var(--body-font);
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--primary);
    color: white;
    text-align: center;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 50px !important;
}

.btn:hover {
    transform: translateY(-2px);
 
    text-decoration: none;
    color: white;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50px !important;
    border-bottom: 2px solid!important;
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-text {
    background-color: transparent;
    color: var(--primary);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-text:hover {
    background-color: rgba(0, 0, 0, 0.05);
    
    transform: none;
}

.btn-textshare {
    background-color: transparent;
    color: var(--primary);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-textshare:hover {
    background-color: var(--primary);
    color:#fff;
    
    transform: none;
}

.btn-large {
    font-size: 1.1rem;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 50px !important;
}

.btn-sm {
    font-size: 0.9rem;
    padding: var(--spacing-xs) var(--spacing-md);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background-color: white;
    border: 1px solid #ddd;
    color: var(--text-dark);
}

.btn-social:hover {
    background-color: #f5f5f5;
    color: var(--text-dark);
}

.btn-google {
    border-color: #ea4335;
}

.btn-google i {
    color: #ea4335;
}

.btn-facebook {
    border-color: #3b5998;
}

.btn-facebook i {
    color: #3b5998;
}

/* ===== Forms ===== */
.form-container {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
  
    max-width: 800px;
    margin: var(--spacing-xl) auto;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-row {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-medium);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: var(--body-font);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.input-with-button {
    display: flex;
    gap: var(--spacing-sm);
}

.input-with-button input {
    flex: 1;
}

small {
    display: block;
    color: var(--text-light);
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
}

/* Checkboxes & Radio buttons */
input[type="checkbox"],
input[type="radio"] {
    margin-right: var(--spacing-xs);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
}

.forgot-link {
    font-size: 0.9rem;
}

/* ===== Alerts ===== */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background-color: rgba(102, 187, 106, 0.1);
    border: 1px solid rgba(102, 187, 106, 0.3);
    color: var(--success);
}

.alert-error {
    background-color: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.3);
    color: var(--error);
}

.alert-warning {
    background-color: rgba(255, 167, 38, 0.1);
    border: 1px solid rgba(255, 167, 38, 0.3);
    color: var(--warning);
}

.alert-info {
    background-color: rgba(41, 182, 246, 0.1);
    border: 1px solid rgba(41, 182, 246, 0.3);
    color: var(--info);
}

/* ===== Hero Section ===== */
.hero {
    background: #FEFAEA;
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero-pattern.svg');
    background-size: cover;
    opacity: 0.1;
    z-index: 0;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-medium);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== Feature Sections ===== */
.how-it-works,
.features,
.testimonials {
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.how-it-works {
    padding-top:80px;
    padding-bottom:80px;
    
}

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

.how-it-works h2,
.features h2,
.testimonials h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xl);
    color: var(--primary-dark);
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    margin-top:-25px;
}

.step {
    flex: 1;
    padding: var(--spacing-lg);
    background-color: none;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
}

.step-icon {
    width: 250px;
    height: autox;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.step h3 {
    margin-bottom: var(--spacing-sm);
}

.cta-center {
    margin-top: -20px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.feature {
    padding: var(--spacing-lg);
    background-color: white;
    border-radius: var(--radius-lg);
  padding-top:65px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.feature h3 {
    margin-bottom: var(--spacing-sm);
}

/* Testimonials */
.testimonial-carousel {
    max-width: 800px;
    margin: 0 auto;
}

.testimonial {
    padding: var(--spacing-xl);
    background-color: white;
    border-radius: var(--radius-lg);
    
    margin: var(--spacing-lg) 0;
}

.quote {
    position: relative;
    padding: 0 var(--spacing-lg);
}

.quote::before {
    content: '\201C';
    font-family: Georgia, serif;
    font-size: 4rem;
    position: absolute;
    left: -20px;
    top: -20px;
    color: var(--primary-light);
    opacity: 0.5;
}

.quote p {
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.8;
}

.author {
    text-align: right;
    margin-top: var(--spacing-md);
}

.author p {
    font-weight: 600;
    color: var(--text-medium);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.cta h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta .btn-primary {
    background-color: white !important;
    color: var(--primary) !important;
}

.cta .btn-primary:hover {
    background-color: var(--primary-light);
    color: white;
}

/* ===== Page Specific Styles ===== */

/* 1. Create Book Page */
.create-book {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
}

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

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-dark);
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto;
}

.sample-stories {
    padding: var(--spacing-xl) 0;
    background-color: var(--background-light);
}

.story-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.story-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    
    transition: transform 0.3s ease;
}

.story-card:hover {
    transform: translateY(-5px);
    
}

.story-img {
    height: 200px;
    overflow: hidden;
}

.story-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .story-img img {
    transform: scale(1.05);
}

.story-info {
    padding: var(--spacing-md);
}

.story-info h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.3rem;
}

.story-info p {
    color: var(--text-medium);
    margin-bottom: 0;
}

/* 2. View Book Page */
.view-book {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
 
}

.status-container {
    background-color: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.status-message {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
}

.progress-bar-container {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-light), var(--primary));
    width: 0;
    transition: width 0.5s ease;
}

/* 3. My Books Page */
.my-books {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-info i {
    font-size: 2.5rem;
    color: var(--primary);
}

.user-info h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.user-info p {
    margin-bottom: 0;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) 0;
}

.empty-state img {
    max-width: 200px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.7;
}

.empty-state h3 {
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-medium);
    margin-bottom: var(--spacing-lg);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.book-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
  
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
   
}

.book-cover {
    height: 200px;
    overflow: hidden;
}

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

.book-info {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-info h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.3rem;
}

.book-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.book-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: auto;
}

/* 4. Auth Pages (Login/Signup) */
.auth-section {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
    background-color: var(--background-light);
}

.auth-container {
    max-width: 900px;
    margin: 0 auto;
}

.auth-content {
    display: flex;
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
 
}

.auth-illustration {
    flex: 1;
    background-color: #f6f2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.auth-illustration img {
    max-width: 100%;
    max-height: 100%;
}

.auth-form {
    flex: 1;
    padding: var(--spacing-xl);
}

.auth-form h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.auth-form p {
    color: var(--text-medium);
    margin-bottom: var(--spacing-lg);
}

.auth-separator {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.auth-separator span {
    margin: 0 var(--spacing-md);
    color: var(--text-light);
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-medium);
}

/* Tabs */
.tabs {
    margin-top: var(--spacing-lg);
}

.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid #eee;
}

.tab-nav li {
    margin-right: var(--spacing-md);
}

.tab-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-medium);
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.tab-link:hover {
    text-decoration: none;
    color: var(--primary);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 5. Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    
    overflow: hidden;
}

.modal-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin-bottom: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: var(--spacing-lg);
}

.share-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: var(--text-dark);
}

.share-option i {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    background-color: #f5f5f5;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-option:hover i {
    transform: scale(1.1);
}

.share-option[id="shareEmail"] i { color: #d54b3d; }
.share-option[id="shareWhatsapp"] i { color: #25d366; }
.share-option[id="shareFacebook"] i { color: #3b5998; }
.share-option[id="shareTwitter"] i { color: #1da1f2; }

/* ===== Footer ===== */
footer {
    background-color: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-logo {
    flex: 2;
}

.footer-logo img {
    height: 55px;
    margin-bottom: var(--spacing-md);
}

.footer-logo p {
    opacity: 0.8;
}

.footer-links {
    flex: 3;
    display: flex;
    justify-content: space-between;
}

.link-group h4 {
    color: white;
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

.link-group a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-sm);
    transition: color 0.3s ease;
}

.link-group a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin-bottom: 0;
    opacity: 0.7;
}

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

.social-links a {
    color: white;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero .container {
        flex-direction: column;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .auth-content {
        flex-direction: column;
    }
    
    .auth-illustration {
        padding: var(--spacing-lg);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .story-cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .book-actions {
        flex-direction: column;
    }
}

/* 
 * Storyteller - Whimsical, Storybook-Inspired Theme
 * Inspired by illustration (child with magical book)
 */

/* ===== Base Styles (Overrides & Additions) ===== */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500&display=swap');

:root {
    /* Magical Storybook Color Palette */
    --primary: #E46203; /* Warm pumpkin orange */
    --primary-light: #ffe8c3; /* Soft peach cream */
    --primary-dark: #E46203; /* Burnt orange */

    --secondary: #2a9d8f; /* Teal green */
    --secondary-light: #9ee0d4; /* Minty green */
    --secondary-dark: #2D413C; /* Deeper teal */

    --accent: #ffe066; /* Golden sparkle */

    --text-dark: #3a3a3a;
    --text-medium: #5e5e5e;
    --text-light: #888888;

    --background: #fffaf3; /* Soft eggshell */
    --background-light: #fef7e6; /* Buttery cream */

    --success: #66bb6a;
    --error: #e53935;
    --warning: #ffa726;
    --info: #29b6f6;

    /* Typography */
    --heading-font: 'Avenir Next', sans-serif;
    --body-font: 'Avenir Next', sans-serif;
    --accent-font: 'Avenir Next', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-circle: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ===== Animations ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes glowPulse {
    0%, 100% {
       
    }
    50% {
       
    }
}

/* ===== Magical Elements ===== */
.magical-glow {
    animation: glowPulse 2.5s ease-in-out infinite;
    border-radius: var(--radius-circle);
}

/* ===== Typography Enhancements ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    color: var(--primary-dark);
    position: relative;
}



/* For special titles or callouts */
.highlight-script {
    font-family: var(--accent-font);
    font-size: 1.3em;
    color: var(--primary-dark);
}

/* ===== Buttons with Magic ===== */
.btn {
    font-family: var(--body-font);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    position: relative;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    
}

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

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
  
}

.btn-accent {
    background-color: var(--accent);
    color: #333;
    
}

.btn-accent:hover {

}

/* ===== Hero Section Enhancements ===== */
.hero {
    
    
    background-size: 20px 20px;
    position: relative;
}

.hero-image img {
    animation: float 6s ease-in-out infinite;
}

/* Optional: Sparkle Overlay */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background-image: url('/images/sparkle-overlay.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
}

/* ===== Cards ===== */
.story-card, .feature, .testimonial {
    background: #ffe8c3;
    clip-path: polygon(
        5% 5%,   /* slightly in from top-left */
        95% 0%,  /* almost top-right */
        100% 95%,/* almost bottom-right */
        0% 100%  /* bottom-left */
      );
    
}

.story-info h3, .book-info h3 {
    font-family: var(--accent-font);
    color: var(--primary-dark);
}

/* ===== Forms & Inputs ===== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    border-radius: var(--radius-md);
    background-color: #fffaf3;
    border: 1px solid #f4a261;
  
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    
}

/* ===== Footer Tweaks ===== */
footer {
    background-color: var(--secondary-dark);
    color: #fff;
    font-family: var(--body-font);
}

footer h4 {
    font-family: var(--accent-font);
    font-size: 1.2rem;
    color: var(--accent);
}

/* ===== Extras ===== */

/* Add sparkles on hover for fun */
.sparkle-hover:hover {
    position: relative;
    animation: glowPulse 2s ease-in-out infinite;
}

/* Floating Stars/Icons (optional) */
.floating-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/floating-stars.svg');
    background-repeat: repeat;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

/* ===== Base & Utility Refinements (Added/Modified) ===== */
html {
    scroll-padding-top: 80px; /* Adjust based on sticky header height */
}

body {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Added class to body when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden; /* Prevent scrolling */
}

.container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* Added utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ===== Header & Navigation (Mobile Focus - Modified for Full Screen) ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Header itself */
    background-color: var(--background);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.logo img {
    height: 90px;
    margin-right: var(--spacing-xs);
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

#main-nav {
    position: static; /* Changed from relative */
}

/* --- Full Screen Mobile Menu Styles --- */

/* Hamburger Button - Needs to be above the menu */
.mobile-menu-button {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-dark);
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative; /* Changed to relative */
    z-index: 1002; /* Above the full screen menu */
    transition: color 0.3s ease; /* Add transition */
}

/* Style button when menu is open (e.g., change color if needed) */
body.mobile-menu-open .mobile-menu-button {
    /* Example: Make it white if menu background is dark */
    /* color: white; */
     position: fixed; /* Keep button fixed position */
     top: 15px; /* Adjust position as needed */
     right: var(--spacing-md); /* Align with container padding */
}


/* Mobile Nav Links Container (Full Screen) */
.nav-links {
    display: none; /* Hidden by default */

    /* Make it full screen when active */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    background-color: rgba(255, 250, 243, 0.98); /* Use your background color, slightly transparent maybe */
    backdrop-filter: blur(5px); /* Optional nice effect */
    z-index: 1001; /* Below the button, above everything else */
    padding: 60px var(--spacing-lg) var(--spacing-lg); /* Add padding, account for fixed button */

    /* Flexbox for centering content */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    /* Animation (Optional Example: Fade in) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Style for when mobile menu is active */
.nav-links.active {
    display: flex; /* Use flex for centering */
    opacity: 1;
    visibility: visible;
}

/* Links inside the full screen menu */
.nav-links a {
    display: block;
    padding: var(--spacing-md) 0; /* Vertical padding */
    font-size: 1.5rem; /* Larger font size */
    color: var(--primary-dark); /* Ensure visibility */
    font-weight: 500;
    border-bottom: none; /* Remove default border */
    width: 80%; /* Limit width slightly */
    margin-bottom: var(--spacing-sm);
}

.nav-links a:hover {
    color: var(--primary);
    background-color: transparent; /* Override potential hover bg */
}

.nav-links a.btn { /* Style button within mobile nav */
    display: inline-block; /* Make it inline-block */
    margin: var(--spacing-lg) 0 0; /* Add top margin */
    padding: var(--spacing-sm) var(--spacing-xl); /* Adjust padding */
    width: auto; /* Reset width */
    font-size: 1.2rem;
}

.nav-links a.active { /* Highlight active link in mobile */
    font-weight: bold;
    color: var(--primary) !important; /* Use important if needed */
    background-color: transparent; /* Remove background highlight */
}


/* --- Desktop Styles (Unchanged from previous - Hides mobile specifics) --- */
@media (min-width: 769px) {
    /* Revert body scroll */
     body.mobile-menu-open {
        overflow: auto;
    }

    .logo img {
        height: 90px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .mobile-menu-button {
        display: none;
    }

    #main-nav {
        position: static; /* Ensure it's static */
    }

    .nav-links {
        display: flex !important; /* Crucial: Override mobile styles */
        flex-direction: row; /* Horizontal layout */
        position: static; /* Reset positioning */
        background-color: transparent;
        backdrop-filter: none;
        box-shadow: none;
        width: auto;
        height: auto; /* Reset height */
        padding: 0;
        opacity: 1; /* Ensure visible */
        visibility: visible; /* Ensure visible */
        transition: none; /* Remove mobile transition */
        gap: var(--spacing-md);
        align-items: center;
    }

    .nav-links a {
        display: inline-block;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem; /* Reset font size */
        color: var(--primary); /* Reset color */
        font-weight: 500;
        border-bottom: none;
        width: auto; /* Reset width */
        margin-bottom: 0; /* Reset margin */
    }

     .nav-links a.btn {
        display: inline-block;
        margin: 0;
        padding: var(--spacing-sm) var(--spacing-lg); /* Restore desktop padding */
        font-size: 1rem; /* Restore font size */
    }

    .nav-links a.active {
        color: var(--primary-dark) !important; /* Use important if needed */
        font-weight: 600;
        background-color: transparent; /* No background highlight */
    }

     .nav-links a:hover {
        background-color: var(--background-light);
        text-decoration: none;
        color: var(--primary-dark);
    }
}


/* ===== Dashboard Section (Mobile Adjustments - Changed/Added) ===== */
.user-dashboard {
     margin-top: var(--spacing-lg);
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.user-info .user-icon {
    font-size: 2.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.user-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0;
}

.user-info p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-light);
}

.dashboard-actions {
    width: 100%;
}

.dashboard-actions .btn {
    width: 100%;
    text-align: center;
}

/* --- Desktop Dashboard Header (Changed/Added) --- */
@media (min-width: 769px) {
    .dashboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-xl);
    }

    .user-info {
        width: auto;
        gap: var(--spacing-md);
    }

     .user-info h2 {
        font-size: 1.5rem;
    }

    .dashboard-actions {
        width: auto;
    }

    .dashboard-actions .btn {
        width: auto;
    }
}

/* ===== Book Grid & Cards (Mobile Adjustments - Changed/Added) ===== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.book-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.book-cover-link {
    display: block;
}

.book-cover {
    height: 180px;
    overflow: hidden;
    background-color: #eee;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-info {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}
.book-title a {
    color: var(--primary-dark);
    text-decoration: none;
}
.book-title a:hover {
    text-decoration: underline;
}


.book-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: auto;
}

.book-actions .btn {
    flex-grow: 1;
}

/* Hide text on very small screens (Changed/Added) */
@media (max-width: 360px) {
    .book-actions .action-text {
       display: none;
    }
    .book-actions .btn {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
        min-width: 40px;
        flex-grow: 0;
    }
}

/* Added Button Style */
.btn-danger-outline {
    background-color: transparent;
    border: 2px solid var(--error);
    color: var(--error);
}
.btn-danger-outline:hover {
    background-color: var(--error);
    color: white;
}

/* ===== Empty State (Changed/Added) ===== */
.empty-state img {
    max-width: 150px;
    margin-bottom: var(--spacing-md);
}

/* ===== Modal Responsiveness (Changed/Added) ===== */
.modal-content {
    width: 90%;
    max-width: 500px;
    margin: var(--spacing-md);
}

.share-options {
    justify-content: space-around;
}

.share-option {
    flex-basis: 80px;
    text-align: center;
}

.share-option span {
    font-size: 0.8rem;
}

.input-with-button {
    display: flex;
}
.input-with-button input {
    flex-grow: 1;
    min-width: 0;
}
.input-with-button button {
    flex-shrink: 0;
}

/* ===== Footer (Mobile Adjustments - Changed/Added) ===== */
.footer-content {
    flex-direction: column;
    gap: var(--spacing-lg);
    text-align: center;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-links {
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
}

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

.footer-bottom {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
}

/* --- Desktop Footer (Changed/Added) --- */
@media (min-width: 769px) {
    .footer-content {
        flex-direction: row;
        text-align: left;
        gap: var(--spacing-xl);
    }

    .footer-logo {
       align-items: flex-start;
    }

    .footer-links {
        flex-direction: row;
        justify-content: space-between;
        gap: var(--spacing-lg);
    }

    .link-group {
        text-align: left;
    }

     .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ===== Whimsical Theme Overrides (Example - Ensure they apply) ===== */
/* If your whimsical theme had specific card styles, re-apply/adjust them here */
.book-card {
    /* Example: background: var(--background-light); */
    /* Example: clip-path: polygon(...); */
}

/* Style for the full-screen nav if needed in whimsical theme */
/* .nav-links.active { background: var(--your-whimsical-menu-bg); } */
