.story-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.story-layout {
    display: flex;
    flex-direction: row-reverse;
    gap: 2rem;
    min-height: calc(100vh - 150px);
    position: relative;
}

.story-content {
    flex: 0 0 70%;
    padding: 0;
    overflow-y: auto;
    height: calc(100vh - 200px);
    margin-right: 25%;
}

.story-text-container {
    padding-top: 0;
}

.full-width-story-title {
    width: 100%;
    padding: 1rem 0 0;
    background-color: rgba(249, 247, 247, 0.95);
    margin-bottom: 0;
    text-align: center;
}

.story-title {
    font-size: 2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #404992;
    position: relative;
    padding-bottom: 0;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    max-width: 1200px;
    margin: 0 auto;
}

.story-options {
    flex: 0 0 30%;
    position: fixed;
    right: 0;
    top: 80px;
    width: 28%;
    height: auto;
    padding: 0 1rem 0 0;
    border-left: none;
    backdrop-filter: blur(10px);
}

.story-choices {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.mobile-header {
    display: none;
    padding: 0.75rem;
    background-color: #e8f0fe;
    border-radius: 1.5rem 1.5rem 0 0;
    cursor: pointer;
    user-select: none;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.message p {
    width: 100%;
    text-align: left;
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-family: 'Raleway', sans-serif;
}

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

.story-message {
    background-color: rgba(255, 255, 255, 0.8);
    color: #2d3748;
    /* border-left: 4px solid #b8c6db; */
}

.user-message {
    background-color: rgba(232, 240, 254, 0.9);
    color: #2d3748;
    margin-left: 2rem;
    border-left: 4px solid #B8BDE1;
}

.decision-options {
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

/* Desktop title for decision-options */
.decision-options::before {
    content: "¿Qué sucede ahora?";
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #B8BDE1;
    font-family: 'Syne', sans-serif;
    text-align: center;
}

.custom-input {
    margin-top: auto;
    padding-top: 1rem;
    border-top: none;
    position: sticky;
    bottom: 0;
    backdrop-filter: blur(10px);
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.custom-input textarea {
    margin-bottom: 1rem;
    min-height: 120px;
    resize: vertical;
    border-radius: 1.5rem;
    padding: 1.25rem;
    border: 2px solid #e8e8e8;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
    font-family: 'Raleway', sans-serif;
}

.custom-input textarea:focus {
    border-color: #B8BDE1;
    box-shadow: 0 0 0 3px rgba(184, 189, 225, 0.3);
    outline: none;
}

.custom-input button {
    width: 100%;
    font-weight: 600;
}

/* Enhanced story content styling */
.story-paragraph {
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.story-paragraph p {
    text-indent: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    font-family: 'Raleway', sans-serif;
}

.story-paragraph h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #B8BDE1;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
}

.story-paragraph h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #85C7D3;
    font-family: 'Syne', sans-serif;
    font-weight: 500;
}

.story-paragraph ul, .story-paragraph ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
    font-family: 'Raleway', sans-serif;
}

.story-paragraph li {
    margin-bottom: 0.5rem;
}

.story-paragraph blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #B8BDE1;
    background-color: rgba(184, 189, 225, 0.1);
    font-style: italic;
    font-family: 'Raleway', sans-serif;
}

.story-paragraph code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* Character dialog styling */
.character-dialog {
    margin: 1.5rem 0;
    padding-left: 2rem;
    position: relative;
    font-family: 'Raleway', sans-serif;
}

.character-dialog::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    color: #B8BDE1;
    font-family: 'Syne', serif;
}

.character-name {
    font-weight: 700;
    color: #85C7D3;
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Syne', sans-serif;
}

/* Scene transition */
.scene-transition {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.scene-transition::before {
    content: '* * *';
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    color: #B8BDE1;
}

/* Dark mode enhancements */
.dark-mode .full-width-story-title {
    background-color: rgba(26, 26, 26, 0.95);
}

.dark-mode .story-message {
    background-color: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
    border-left-color: #404992;
}

.dark-mode .user-message {
    background-color: rgba(74, 85, 104, 0.9);
    color: #e2e8f0;
    border-left-color: #B8BDE1;
}

.dark-mode .decision-options, 
.dark-mode .custom-input {
    background-color: rgba(45, 55, 72, 0.8);
}

.dark-mode .decision-options::before {
    color: #B8BDE1;
}

.dark-mode .story-paragraph h2,
.dark-mode .story-paragraph h3 {
    color: #B8BDE1;
}

.dark-mode .character-name {
    color: #85C7D3;
}

.dark-mode .character-dialog::before {
    color: #B8BDE1;
}

.dark-mode .scene-transition::before {
    color: #B8BDE1;
}

.dark-mode .story-paragraph blockquote {
    border-left-color: #B8BDE1;
    background-color: rgba(184, 189, 225, 0.2);
}

.dark-mode .story-paragraph code {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .story-title {
    color: #B8BDE1;
}

@media (max-width: 768px) {
    .story-layout {
        flex-direction: column;
    }

    .story-content {
        flex: 0 0 100%;
        margin-right: 0;
        height: calc(100vh - 130px);
        padding-bottom: 60px;
    }

    .story-options {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 80vh;
        border-top: 1px solid #e8e8e8;
        padding: 0;
        z-index: 10;
    }

    .mobile-header {
        display: block;
    }

    .decision-options::before {
        display: none; /* Hide desktop title on mobile */
    }

    .options-content {
        padding: 1rem;
        transition: max-height 0.3s ease;
        overflow: hidden;
        max-height: 70vh;
    }

    .options-content.collapsed {
        max-height: 0;
        padding: 0;
    }
    
    .story-paragraph p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .message p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .story-paragraph h2 {
        font-size: 1.5rem;
    }
    
    .story-paragraph h3 {
        font-size: 1.3rem;
    }
    
    .story-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .story-paragraph {
        padding: 0 0.5rem;
    }
    
    .story-paragraph p {
        text-indent: 1rem;
    }
    
    .character-dialog {
        padding-left: 1.5rem;
    }
    
    .message {
        padding: 1.25rem;
    }
    
    .story-title {
        font-size: 1.75rem;
    }
}
