body {
    font-family: 'Inter', sans-serif; /* Use Inter from Google Fonts */
    margin: 0;
    padding: 0;
    padding-bottom: 60px; /* Padding for the bottom navigation */
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box; /* Important for the overall box model */
}

.header {
    width: 100%;
    background-color: #e0e8f0;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Logo styles - leaving as is */
.logo {
    height: 70px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
}

main {
    max-width: 100%;
    width: 90%; /* Base width for desktops and tablets */
    padding: 1rem;
    flex-grow: 1; /* Allows main to take up available space */
    box-sizing: border-box;
    overflow-y: auto; /* Add scrolling for main if content overflows */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* General style for main content containers */
.content-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%; /* Container takes full available width of main */
    margin: 0 auto; /* Centering */
    box-sizing: border-box; /* Account for padding in width */
}

/* Styles for forms inside containers */
.form-group {
    margin-bottom: 15px; /* Reduced margin */
    width: 100%;
    text-align: left;
}

/* Add this to the section where you define styles for input and form-group */
.input-container {
    position: relative; /* So the icon is positioned relative to this container */
    display: flex; /* Use flexbox */
    align-items: center; /* Vertically align items to the center */
    width: 100%; /* Take full available width */
}

.input-container input {
    flex-grow: 1; /* The input field will take up the maximum available space */
    padding-right: 40px; /* Add right padding so text doesn't go under the icon */
}

.input-container .password-toggle {
    position: absolute; /* Position the icon absolutely */
    right: 15px; /* Offset from the right edge of the container */
    cursor: pointer;
    color: #888; /* Icon color */
    font-size: 18px; /* Icon size */
    /* Additional icon styles if needed */
}

label {
    display: block;
    margin-bottom: 5px; /* Reduced margin */
    font-weight: 500; /* Slightly less bold font */
    color: #555;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 10px; /* Increased padding */
    font-size: 16px; /* Increased font size */
    border: 1px solid #ddd; /* Lighter border */
    border-radius: 5px; /* More rounded corners */
    box-sizing: border-box;
    background-color: #f9f9f9; /* Light background for fields */
    color: #333;
}

input::placeholder, textarea::placeholder {
    color: #aaa; /* Placeholder color */
}

textarea {
    resize: vertical;
}

button {
    width: 100%;
    padding: 12px; /* Increased padding */
    background-color: #5a67d8; /* Blue color */
    color: white;
    border: none;
    border-radius: 5px; /* More rounded corners */
    font-size: 16px; /* Increased font size */
    cursor: pointer;
    margin-top: 10px; /* Increased top margin */
    transition: background-color 0.3s ease;
    font-weight: 600;
}

button:hover {
    background-color: #434190; /* Darker on hover */
}

.bottom-nav {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background: #f8f8f8; /* Navigation background color */
}
.nav-icon {
    width: 56px;
    height: 56px;
    margin: 0 20px;
    transition: opacity 0.3s ease;
}
.nav-icon:hover {
    opacity: 0.7;
}

/* Google Sign-in/Sign-up button styles */
.google-button {
    background-color: #ffffff; /* White background */
    color: #555;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px; /* Top margin */
}

.google-button img {
    width: 20px;
    height: 20px;
}

.google-button:hover {
    background-color: #f0f0f0; /* Lighter on hover */
}


/* "Or" divider styles */
.or-divider {
    margin: 20px 0;
    color: #888;
    position: relative;
    text-align: center;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: #ddd;
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}


/* Login/Registration link styles */
.auth-link {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.auth-link a {
    color: #5a67d8; /* Blue link color */
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}


/* Styles for #prompt-section and #story-result */
#prompt-section, #story-result {
    margin-top: 0; /* Remove top margin, as it will be on the container */
    padding: 0; /* Remove padding, as the container will have it */
    background-color: transparent; /* Transparent background */
    box-shadow: none; /* Remove shadow */
    border-radius: 0; /* Remove border-radius */
    width: 100%; /* Takes full width of parent container */
    box-sizing: border-box;
}

/* Increase max-width for #prompt-section */
main #prompt-section {
    max-width: 700px; /* Increase max-width for the form */
    width: 100%; /* Ensure it takes full available width up to max-width */
    margin: 0 auto; /* Center */
}


/* Styles for input fields inside #prompt-section on index.html */
#prompt-section input[type="text"],
#prompt-section input[type="number"], /* Added number for age field */
#prompt-section select,
#prompt-section textarea {
    width: 100%; /* Input fields take full available width */
    max-width: none; /* Remove max-width limitation */
}


#debug-info {
    font-size: 0.9rem;
    color: #555;
    margin: 10px 0; /* Added margins */
    text-align: center;
}

.story-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16pt;
    padding: 10px; /* Added slight padding */
    background-color: #f9f9f9; /* Light background for story text */
    border-radius: 5px;
    margin-bottom: 15px; /* Bottom margin */
}

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

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
}

.modal-body p {
    margin: 10px 0;
}

.modal-footer {
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.modal-footer button {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-footer button:hover {
    background-color: #0056b3;
}


/* Play button styles - leaving as is */
.play-button {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.play-button:hover {
    background-color: #218838;
}

.play-button::before {
    content: "▶";
    font-size: 1.2em;
}

/* Spinner styles - leaving as is */
.spinner-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Privacy, Terms, About content styles - leaving as is */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}
.privacy-content h2, .privacy-content h3, .privacy-content h4 {
    margin-top: 20px;
    color: #333;
}
.privacy-content p {
    margin-bottom: 10px;
}
.privacy-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.terms-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}
.terms-content h2, .terms-content h3, .terms-content h4 {
    margin-top: 20px;
    color: #333;
}
.terms-content p {
    margin-bottom: 10px;
}
.terms-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}
.terms-content a {
    color: #007bff;
    text-decoration: none;
}
.terms-content a:hover {
    text-decoration: underline;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}
.about-content h2, .about-content h3, .about-content h4 {
    margin-top: 20px;
    color: #333;
}
.about-content p {
    margin-bottom: 10px;
}
.about-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}
.about-content a {
    color: #007bff;
    text-decoration: none;
}
.about-content a:hover {
    text-decoration: underline;
}


/* Review page specific styles */
.review-button { /* Leaving as is, or can be a more general button style */
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.review-button:hover {
    background-color: #45a049;
}
/* Styles for textarea in the review form */
#review-form textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    background-color: #f9f9f9;
    font-size: 1rem;
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Settings styles - leaving as is, they are already well-styled */
.settings-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%; /* Changed to 100% for use within main */
    margin: 0 auto; /* Centering */
    box-sizing: border-box;
}

.settings-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.user-section {
    margin-bottom: 20px;
}

.user-box {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-icon {
    width: 40px;
    height: 40px;
    background-color: #e0e0e0;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
}

.user-text {
    flex: 1;
}

/* .signup-link - renamed to .auth-link */
/* p - general style above */
.section {
    margin-bottom: 10px;
}

.section h2 {
    font-size: 18px;
    color: #444;
    margin-bottom: 15px;
    padding-left: 10px;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    transition: background-color 0.3s, transform 0.2s;
    cursor: pointer; /* Added cursor */
}

.setting-item:hover {
    background-color: #f9f9f9;
    transform: translateX(5px);
}

.setting-item i {
    margin-right: 12px;
    color: #666;
    font-size: 16px;
}

.setting-item span {
    flex-grow: 1;
    color: #333;
    font-size: 16px;
}

.setting-item .fa-chevron-right {
    color: #999;
    font-size: 14px;
}


/* Language selection styles - leaving as is */
.language-container {
    text-align: center;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin: 10px 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.language-option:hover {
    background-color: #e0e0e0;
}

.language-option.selected {
    border-color: #007bff;
    background-color: #e7f0fa;
}

.flag {
    width: 30px;
    height: 20px;
    margin-right: 10px;
}


/* Loading spinner - leaving as is */
#loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

/* In your static/styles.css */
.load-more-btn-style {
    display: block; /* So the button takes full width and can be centered */
    margin: 20px auto; /* Top/bottom margin and horizontal centering */
    padding: 10px 20px;
    background-color: #007bff; /* Example color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
}

.load-more-btn-style:hover {
    background-color: #0056b3;
}

/* If you have a loading indicator inside the button, or its text changes */
.load-more-btn-style:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}


/* Audio controls - leaving as is */
#audio-controls, #audio-player {
    display: none;
    margin-top: 20px;
}


/* Bottom navigation styles - leaving as is */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
     padding: 5px;
    transition: transform 0.2s, color 0.2s;
}

.nav-button:hover {
    transform: scale(1.2);
    color: #a445ed;
}


/* Story card styles - leaving as is */
.story-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.story-card {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.story-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.story-card p {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #555;
}

.read-more {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

.story-container-with-icons {
    position: relative; /* Make the story container a positioning context */
    padding-bottom: 40px; /* Add bottom padding so icons don't overlap text */
}

.story-icons {
    position: absolute; /* Position icons absolutely within the container */
    bottom: 10px; /* Offset from the bottom edge */
    right: 10px; /* Offset from the right edge */
    display: flex; /* Use flexbox to arrange icons in a row */
    gap: 10px; /* Spacing between icons */
}

.story-icons i {
    font-size: 2em; /* Icon size */
    color: #555; /* Icon color */
    opacity: 0.5; /* Semi-transparent */
    cursor: pointer; /* Cursor on hover */
    transition: opacity 0.3s ease, color 0.3s ease; /* Smooth transition on hover */
}

.story-icons i:hover {
    opacity: 1; /* Full opacity on hover */
    color: #000; /* Color on hover */
}

/* Optionally add styles for specific icons if needed */
.story-icons .fa-save:hover {
    color: #28a745; /* Green on hover for save */
}

.story-icons .fa-trash-alt:hover {
    color: #dc3545; /* Red on hover for delete */
}


/* Mobile-specific styles - leaving as is, minor adjustments might be needed */
@media (max-width: 600px) {
    main {
        width: 98%; /* Increased width on mobile */
        padding: 0.5rem 0;
    }

    .content-container {
        padding: 15px; /* Reduced padding on mobile */
    }

    input, select, textarea, button {
        font-size: 1rem; /* Reverted font size */
        padding: 10px;
    }

    .home-button { /* This class might no longer be used */
        font-size: 1rem;
        padding: 10px;
    }

    #debug-info {
        font-size: 0.8rem;
    }

    .story-text {
        font-size: 14pt; /* Reduced font size */
        padding: 8px;
    }

    #story-content h3 { /* This selector might no longer be used */
        font-size: 1.1rem;
    }

    .nav-button {
        font-size: 1.2rem;
        padding: 8px;
    }

    .story-card h3 {
        font-size: 1rem;
    }

    .story-card p {
        font-size: 0.9rem;
    }
}

/* RTL support and fonts for different languages - leaving as is */
html[lang="ar"] {
    direction: rtl;
}

html[lang="ar"] body {
    text-align: right;
}

html[lang="ar"] .language-option {
    flex-direction: row-reverse;
}

html[lang="ar"] .flag {
    margin-right: 0;
    margin-left: 10px;
}

html[lang="ar"] .form-group label,
html[lang="ar"] .modal-body p,
html[lang="ar"] .modal-header h2,
html[lang="ar"] .story-text {
    text-align: right;
}

html[lang="ar"] .modal-footer {
    text-align: left;
}

html[lang="ar"] .home-button {
    left: auto;
    right: 1rem;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Arabic&family=Noto+Sans+JP&family=Noto+Sans+KR&family=Noto+Sans+SC&display=swap');

html[lang="ar"] {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}
html[lang="ja"] {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
}
html[lang="ko"] {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
}
html[lang="zh"] {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
}
/* For other languages, Inter will be used by default from the body */