/* Mobile-first CSS Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding-top: 60px; /* Space for fixed header */
    padding-bottom: 80px; /* Space for fixed footer */
}

body.chat-page {
    padding-bottom: 0; /* Chat interface handles its own spacing */
    height: 100vh;
    overflow: hidden;
}

/* Cart page needs more bottom padding for footer buttons */
body.cart-page {
    padding-bottom: 200px; /* Extra space for footer buttons */
}

@media (min-width: 768px) {
    body.cart-page {
        padding-bottom: 150px; /* Less space needed on tablet/desktop */
    }
}

/* Container - Mobile First */
.container {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

/* Header & Navigation - Mobile First */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #fff;
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
}

.menu {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin: 0 auto;
}

.menu .logo {
    font-size: 1.125rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.5;
}

.logo-icon {
    height: 1em;
    width: auto;
    flex-shrink: 0;
}

.menu-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.site-link {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
}

.site-link:hover,
.site-link:focus {
    text-decoration: underline;
    outline: none;
}

/* Main Content - Mobile First */
main {
    width: 100%;
    min-height: calc(100vh - 140px); /* Ensure content doesn't get too short (accounting for header and footer) */
}

.artwork-page {
    width: 100%;
}

.artwork-page h1 {
    font-size: 1.125rem !important;
    font-weight: bold !important;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333 !important;
    line-height: 1.5 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Artwork Image - Mobile First */
.artwork-image {
    width: 100%;
    margin: 0 auto 2rem;
    text-align: center;
}

.artwork-image img {
    width: 100%;
    max-width: 100%;
    max-height: 66.67vh;
    height: auto;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
    object-fit: contain;
}

.artwork-image img:hover {
    opacity: 0.9;
}

/* Description Section - Mobile First */
.description {
    width: 100%;
    margin: 0 auto 2rem;
    text-align: left;
}

.audio-player {
    text-align: center;
    margin-bottom: 1.5rem;
}

.audio-player audio {
    width: 100%;
    max-width: 400px;
}

.description p {
    margin-bottom: 1rem;
    text-align: justify;
}

.description p:last-child {
    margin-bottom: 0;
}

.description .separator {
    text-align: center;
    font-size: 1.5rem;
    margin: 1.5rem 0 0;
    color: #666;
    letter-spacing: 0.5rem;
}

/* Purchase Section - Mobile First */
.purchase-section {
    width: 100%;
    margin: 2rem auto;
}

.purchase-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #333;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-radius: 4px;
}

.btn:hover,
.btn:focus {
    background-color: #333;
    color: #fff;
    outline: none;
}

.btn-primary {
    background-color: #333;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #555;
}

.btn-secondary {
    background-color: #fff;
    color: #333;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #f5f5f5;
}

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

/* Artwork List - Mobile First */
.artwork-list {
    width: 100%;
    margin: 0 auto 2rem;
}

.artwork-items {
    list-style: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0;
}

.artwork-item {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.artwork-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    width: 100%;
}

.artwork-link:hover,
.artwork-link:focus {
    color: #666;
    outline: none;
}

.artwork-tile-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.artwork-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.artwork-title {
    font-size: 0.95rem;
    font-weight: 400;
    text-align: center;
    line-height: 1.4;
    padding: 0 0.25rem;
}

/* Cart page - Override grid to list layout */
.cart-page .artwork-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    grid-template-columns: none !important;
}

.cart-page .artwork-item {
    width: 100% !important;
    border-bottom: 1px solid #e0e0e0;
    display: block !important;
}

.cart-page .artwork-item:last-child {
    border-bottom: none;
}

.cart-page .artwork-link {
    display: inline !important;
    padding: 0 !important;
    flex-direction: row !important;
}

.cart-page .artwork-tile-image {
    display: none !important;
}

.cart-page .artwork-title {
    font-size: 1.125rem !important;
    font-weight: 400 !important;
    text-align: left !important;
    padding: 0 !important;
    line-height: normal !important;
    display: inline !important;
}

.cart-page .cart-item-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
    padding: 1.5rem 0 !important;
}

.cart-page .cart-item-row-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

.cart-page .cart-item-price {
    margin: 0 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

.cart-page .cart-item-button {
    margin-left: auto !important;
    min-width: 120px !important;
    flex-shrink: 0 !important;
}

/* Pagination - Mobile First */
.pagination {
    width: 100%;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pagination-link {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid #333;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-link:hover:not(.disabled),
.pagination-link:focus:not(.disabled) {
    background-color: #333;
    color: #fff;
    outline: none;
}

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

.pagination-prev::before {
    content: '← ';
}

.pagination-next::after {
    content: ' →';
}

/* Technical Details - Mobile First */
.technical-details {
    width: 100%;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.technical-details h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.technical-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.technical-details p {
    margin-bottom: 0.5rem;
}

/* Cart Section - Mobile First */
.cart-section {
    width: 100%;
    margin: 2rem auto;
}

.cart-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info p {
    margin-bottom: 0.5rem;
}

.cart-item-info p:last-child {
    margin-bottom: 0;
    color: #666;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cart-total {
    width: 100%;
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid #333;
    text-align: right;
}

.cart-total p {
    font-size: 1.25rem;
    margin: 0;
}

.cart-item-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.cart-item-row-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.cart-item-price {
    margin: 0;
    font-weight: 500;
}

.cart-item-button {
    min-width: 120px;
    align-self: flex-start;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    .container {
        padding: 0 5%;
        max-width: 1200px;
    }

    .menu {
        padding: 0.75rem 5%;
    }

    .menu-links {
        gap: 1.5rem;
    }

    footer {
        padding: 1rem 0;
    }

    .footer-content {
        padding: 0 5%;
        max-width: 1200px;
    }

    .footer-nav-button {
        width: 44px;
        height: 44px;
    }

    .footer-nav-button svg {
        width: 28px;
        height: 28px;
    }

    .artwork-page h1 {
        font-size: 1.125rem !important;
        font-weight: bold !important;
        color: #333 !important;
        line-height: 1.5 !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    }

    .artwork-image {
        width: 100%;
    }

    .artwork-list {
        max-width: 100%;
    }

    .artwork-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .artwork-title {
        font-size: 1rem;
    }

    .description {
        max-width: 80%;
    }

    .purchase-buttons {
        flex-direction: row;
        justify-content: flex-end;
        max-width: 80%;
        margin-left: auto;
        margin-right: auto;
    }

    .btn {
        min-width: 150px;
    }

    .pagination {
        max-width: 80%;
    }

    .technical-details {
        max-width: 80%;
    }

    .cart-section {
        max-width: 80%;
    }

    .cart-item {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .cart-item-image {
        width: 100px;
        height: 100px;
    }

    .cart-item-actions {
        margin-left: auto;
    }

    .cart-item-row {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .cart-item-row-content {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .cart-item-button {
        margin-left: auto;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .container {
        padding: 0 10%;
    }

    .menu {
        padding: 0.75rem 10%;
    }

    .artwork-page h1 {
        font-size: 1.125rem !important;
        font-weight: bold !important;
        color: #333 !important;
        line-height: 1.5 !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    }

    .artwork-list {
        max-width: 100%;
    }

    .artwork-items {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .artwork-title {
        font-size: 1.05rem;
    }

    .description {
        max-width: 70%;
    }

    .purchase-buttons {
        max-width: 70%;
    }

    .pagination {
        max-width: 70%;
    }

    .technical-details {
        max-width: 70%;
    }

    .cart-section {
        max-width: 70%;
    }

    footer {
        padding: 1.25rem 0;
    }

    .footer-content {
        padding: 0 10%;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Cart badge in navigation */
.site-link {
    position: relative;
}

.cart-badge {
    display: inline-block;
    background-color: #333;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.2em 0.5em;
    border-radius: 10px;
    margin-left: 0.5rem;
    min-width: 1.5em;
    text-align: center;
    line-height: 1.2;
}

/* Fixed Footer - Mobile First */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Cart page footer - needs more space for buttons */
.cart-page footer {
    padding: 1rem;
    min-height: auto;
}

.footer-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 40px;
}

.footer-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
    color: #333;
}

.footer-nav-button:hover:not(.disabled),
.footer-nav-button:focus:not(.disabled) {
    opacity: 0.7;
    outline: none;
}

.footer-nav-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.footer-nav-button svg {
    width: 24px;
    height: 24px;
    fill: #1A1A1A;
    fill-opacity: 0.5;
}

.footer-nav-button.disabled svg {
    fill-opacity: 0.2;
}

.footer-toast {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #333;
}

.footer-toast:empty {
    display: none;
}

.footer-add-to-cart {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #333;
    background-color: #333;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-radius: 4px;
    white-space: nowrap;
}

.footer-add-to-cart:hover,
.footer-add-to-cart:focus {
    background-color: #555;
    outline: none;
}

.footer-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Cart page footer buttons */
.footer-cart-actions {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.footer-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    padding: 0 1rem;
    align-items: stretch;
}

.footer-cart-buttons .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #333;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-radius: 4px;
}

.footer-cart-buttons .btn-primary {
    background-color: #333;
    color: #fff;
}

.footer-cart-buttons .btn-primary:hover:not(:disabled),
.footer-cart-buttons .btn-primary:focus:not(:disabled) {
    background-color: #555;
    outline: none;
}

.footer-cart-buttons .btn-secondary {
    background-color: #fff;
    color: #333;
}

.footer-cart-buttons .btn-secondary:hover:not(:disabled),
.footer-cart-buttons .btn-secondary:focus:not(:disabled) {
    background-color: #f5f5f5;
    outline: none;
}

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

/* Tablet and Desktop - Cart footer buttons */
@media (min-width: 768px) {
    .footer-cart-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        padding: 0 2rem;
        max-width: 800px;
        margin: 0 auto;
    }

    .footer-cart-buttons .btn {
        min-width: 150px;
        flex: 0 1 auto;
    }
}

/* Image Zoom Modal - Mobile First */
.image-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-zoom-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.2s ease;
    padding: 0;
    font-weight: bold;
}

.image-zoom-close:hover,
.image-zoom-close:focus {
    background-color: #fff;
    transform: scale(1.1);
    outline: none;
}

.image-zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.image-zoom-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
    cursor: grab;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.image-zoom-img:active {
    cursor: grabbing;
}

.image-zoom-img.zoomed {
    cursor: grab;
}

/* Tablet and Desktop - Larger close button */
@media (min-width: 768px) {
    .image-zoom-close {
        top: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }
}

/* Cards Game Styling */
.cards-page {
    max-width: 800px;
    margin: 0 auto;
}

.cards-intro {
    margin-bottom: 2rem;
    text-align: center;
}

.cards-intro p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
}

.cards-form-section {
    margin: 2rem 0;
}

.cards-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cards-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.cards-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease;
}

.cards-textarea:focus {
    outline: none;
    border-color: #333;
}

.cards-submit-btn {
    align-self: flex-start;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.cards-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.cards-error {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 1rem;
    color: #c33;
    margin-top: 1rem;
}

/* Reading Pages */
.reading-page {
    max-width: 900px;
    margin: 0 auto;
}

.reading-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.reading-card-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.reading-header {
    text-align: center;
    margin-bottom: 1rem;
}

.reading-header h1 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.tarot-card-name {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    font-style: italic;
}

.reading-artwork {
    margin: 0;
    text-align: center;
}

.reading-artwork img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.artwork-title-reading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.reading-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

.reading-description p {
    margin: 0;
}

.reading-actions {
    text-align: center;
    margin-top: 2rem;
}

.reading-add-cart {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.reading-complete {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.reading-view-story {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Story Page */
.story-page {
    max-width: 1000px;
    margin: 0 auto;
}

.story-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.story-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.story-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.story-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.story-intention {
    font-size: 1.125rem;
    color: #555;
    font-style: italic;
}

.story-overall {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.story-overall h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.story-overall p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1rem;
}

.story-cards {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.story-card {
    padding: 2rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.story-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.story-card-header h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.story-artwork-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.story-artwork {
    text-align: center;
    margin: 1.5rem 0;
}

.story-artwork img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.story-card-reading {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
}

.story-products {
    margin-top: 2rem;
}

.story-products h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
}

.story-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.story-product-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.story-product-image {
    margin: 0;
    text-align: center;
}

.story-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.story-product-info {
    text-align: center;
}

.story-product-info h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.story-product-card {
    font-style: italic;
    color: #666;
    margin-bottom: 0.5rem;
}

.story-product-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.story-add-cart {
    width: 100%;
    padding: 0.75rem;
}

.story-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.story-add-all,
.story-download {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Tablet and Desktop - Cards Game */
@media (min-width: 768px) {
    .cards-intro p {
        font-size: 1.25rem;
    }

    .cards-textarea {
        min-height: 150px;
    }

    .tarot-card-name {
        font-size: 2.5rem;
    }

    .reading-description {
        font-size: 1.25rem;
    }

    .story-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-actions {
        flex-direction: row;
        justify-content: center;
    }
}

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

/* Reading All Cards Page - Single Page Display */
.reading-all-page {
    max-width: 1000px;
    margin: 0 auto;
}

.reading-all-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.reading-all-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.reading-all-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.reading-all-intention {
    font-size: 1.125rem;
    color: #555;
    font-style: italic;
}

.reading-all-cards {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.reading-all-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.reading-all-card-header {
    text-align: center;
}

.reading-all-card-header h2 {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.reading-all-card-name {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    font-style: italic;
}

.reading-all-card-image {
    margin: 0;
    text-align: center;
}

.reading-all-card-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.reading-all-card-meaning {
    text-align: center;
}

.reading-all-artwork-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.reading-all-card-meaning p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    margin: 0;
}

.reading-all-story {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.reading-all-story h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #333;
}

.reading-all-story-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
}

.reading-all-story-content p {
    margin-bottom: 1rem;
}

.reading-all-story-content p:last-child {
    margin-bottom: 0;
}

.reading-all-actions {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.reading-all-add-all {
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Tablet and Desktop - Reading All */
@media (min-width: 768px) {
    .reading-all-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .reading-all-card-header {
        flex: 0 0 150px;
        text-align: left;
    }

    .reading-all-card-image {
        flex: 0 0 300px;
    }

    .reading-all-card-meaning {
        flex: 1;
        text-align: left;
    }

    .reading-all-card-name {
        font-size: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .reading-all-card-image {
        flex: 0 0 400px;
    }
}

/* Chat Interface Styling */
body.chat-page footer {
    display: none; /* Hide footer on chat page */
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* Account for header only */
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-in;
}

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

.chat-message-user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-message-text {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-message-user .chat-message-text {
    background-color: #333;
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-message-assistant .chat-message-text {
    background-color: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 0.25rem;
}

.chat-input-container {
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
    padding: 1rem;
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-form {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 1.5rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #333;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    outline: none;
}

.chat-send-btn {
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    padding: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background-color: #555;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Reading content in chat */
.chat-reading-content {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 100%;
}

.chat-reading-theme {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.chat-reading-theme h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.chat-reading-theme p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 0.5rem;
}

.chat-reading-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.reading-card-inline {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    padding: 1rem;
}

.reading-card-inline-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.reading-card-inline-header strong {
    font-size: 1.25rem;
    color: #333;
    font-weight: 600;
    display: block;
}

.reading-card-inline-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
    display: block;
}

.reading-card-meaning {
    line-height: 1.7;
    color: #555;
    margin: 0.75rem 0 0 0;
}

.chat-reading-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.chat-add-all-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Tablet and Desktop - Chat */
@media (min-width: 768px) {
    .chat-messages {
        padding: 2rem;
    }

    .chat-message {
        max-width: 75%;
    }

    .chat-input-container {
        padding: 1.5rem;
    }

    .reading-card-inline {
        display: flex;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .reading-card-inline-image {
        flex: 0 0 200px;
        max-width: 200px;
        margin: 0;
    }

    .reading-card-inline-header {
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .chat-message {
        max-width: 70%;
    }
}

/* Chat Options Menu */
.chat-options-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-options-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 36px;
    height: 36px;
}

.chat-options-btn:hover {
    background-color: #f0f0f0;
}

.chat-options-btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.chat-options-menu {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    padding: 0.5rem 0;
}

.chat-options-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure menu appears above input on mobile */
@media (max-width: 767px) {
    .chat-options-menu {
        bottom: calc(100% + 0.5rem);
        top: auto;
        left: 0;
        right: auto;
    }
}

.chat-options-item {
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.chat-options-item:hover {
    background-color: #f5f5f5;
}

.chat-options-item:focus {
    outline: none;
    background-color: #f5f5f5;
}

.chat-options-item:active {
    background-color: #e8e8e8;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .chat-options-menu {
        right: 0;
        left: auto;
    }
}

