/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


.storywell-logo {
    display: block;
    width: 500px; /* Adjust size to match mockup */
    height: auto; /* Maintain aspect ratio */
    margin: 0 auto 30px auto; /* Center the logo and add spacing below */
    position: relative;
    z-index: 2;
}

body {
    font-family: 'sans-serif', Verdana;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8c0 25%, #7fcdcd 50%, #81c3d7 75%, #86b7df 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #4a90e2, transparent),
        radial-gradient(2px 2px at 40px 70px, #4a90e2, transparent),
        radial-gradient(1px 1px at 90px 40px, #4a90e2, transparent),
        radial-gradient(1px 1px at 130px 80px, #4a90e2, transparent),
        radial-gradient(2px 2px at 160px 30px, #4a90e2, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Design Layout Matching Exact Image */
.design-layout {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    overflow: hidden;
}

/* Top Stars */
.top-stars {
    position: absolute;
    top: 20px;
    right: 100px;
    z-index: 10;
}

.star-outline {
    position: absolute;
    width: 40px;
    height: 40px;
}

.star-1 {
    top: 0;
    right: 200px;
    width: 35px;
    height: 35px;
}

.star-2 {
    top: 40px;
    right: 150px;
    width: 45px;
    height: 45px;
}

.star-3 {
    top: 80px;
    right: 80px;
    width: 50px;
    height: 50px;
}

.star-4 {
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
}

/* Left Content Area */
.left-content {
    flex: 1;
    padding: 80px 60px;
    position: relative;
    z-index: 5;
    max-width: 50%;
}

.left-star-outline {
    position: absolute;
    top: 120px;
    left: 20px;
    width: 60px;
    height: 60px;
    z-index: 1;
}

.storywell-title {
    font-family: 'sans-serif', Verdana;
    font-size: 5rem;
    color: #2c5aa0;
    margin: 40px 0 30px 0;
    line-height: 0.9;
    position: relative;
    z-index: 2;
}

.description-text {
    font-family: 'sans-serif', Verdana;
    font-size: 1.3rem;
    color: #2c5aa0;
    line-height: 1.5;
    margin-bottom: 40px;
    max-width: 450px;
}

.italic-text {
    font-style: italic;
    font-weight: bold;
}

.start-recording-btn {
    background: linear-gradient(45deg, #88d8c0, #7fb3d3);
    border: none;
    border-radius: 30px;
    padding: 15px 30px;
    margin: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 179, 211, 0.3);
    font-family: ' sans-serif', Verdana;
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-recording-btn,
.storybook-btn {
    width: 100%;               /* take full width of .left-content */
    max-width: 300px;          /* optional cap */
    margin: 0;                 /* remove auto centering */
}

.start-recording-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 179, 211, 0.4);
}

.mic-icon {
    font-size: 1.3rem;
}

/* Right Content Area */
.right-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 50%;
}

.wishing-well-container {
    position: relative;
    width: 90%;
    height: 60%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.wishing-well-svg {
    transform: translateX(50px);
}

.wishing-well-image {
    width: 83%;
}

.buttons-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* align buttons to the left */
    gap: 20px;                /* space between buttons */
    margin-top: 20px;         /* optional spacing above buttons */
}

.storybook-btn {
    background: linear-gradient(45deg, #88d8c0, #7fb3d3); /* Initial gradient */
    border: none;
    border-radius: 30px;
    padding: 15px 30px;
    font-size: 1.2rem; 
    font-weight: bold;
    width: 300px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 179, 211, 0.3);
    font-family: 'sans-serif', Verdana;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.storybook-btn:hover {
    background: linear-gradient(45deg, #7fb3d3, #88d8c0); /* Reverse gradient on hover */
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 6px 20px rgba(127, 179, 211, 0.4); /* Enhanced shadow on hover */
}

/* Add bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}


/* Card Styles for Functional Interface */
.card {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin: 30px;
    box-shadow: 0 10px 30px rgba(44, 90, 160, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.6);
    animation: slideInUp 0.8s ease-out;
    position: relative;
}

.card-header {
    text-align: center;
    height: 100px;
    margin-bottom: 30px;
}

.card-header h2 {
    font-family: 'sans-serif', Verdana;
    font-size: 2rem;
    color: #2c5aa0;
    margin-bottom: 10px;
}

.card-header p {
    font-size: 1.1rem;
    color: #4a6fa5;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.record-btn {
    background: linear-gradient(45deg, #7fb3d3, #95c5e1);
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(127, 179, 211, 0.4);
}

.your-stories-img {
    height: 80%;           
    display: block;
    margin: 0 auto 30px;  
}

.record-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(127, 179, 211, 0.6);
}

.record-btn.recording {
    background: linear-gradient(45deg, #ff4757, #ff3838);
    animation: pulse 1.5s infinite;
}

.mic-icon {
    font-size: 1.5rem;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #555;
}

.pulse-animation {
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

/* Audio Preview */
.audio-preview {
    text-align: center;
    padding: 20px;
    background: rgba(240, 248, 255, 0.8);
    border-radius: 15px;
    margin-top: 20px;
}

.audio-preview h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.audio-preview audio {
    margin: 15px 0;
    width: 100%;
    max-width: 400px;
}

.retry-btn, .process-btn {
    margin: 10px;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn {
    background: linear-gradient(45deg, #a8d8ea, #b8e6b8);
    color: white;
}

.process-btn {
    background: linear-gradient(45deg, #88d8c0, #a8e6cf);
    color: white;
}

.retry-btn:hover, .process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Processing Animation */
.processing-section {
    text-align: center;
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    position: relative;
}

.magic-wand {
    font-size: 3rem;
    animation: rotate 2s linear infinite;
}

.sparkles {
    position: absolute;
    display: flex;
    gap: 20px;
}

.sparkles span {
    font-size: 1.5rem;
    animation: twinkle 1.5s ease-in-out infinite;
}

.sparkles span:nth-child(1) { animation-delay: 0s; }
.sparkles span:nth-child(2) { animation-delay: 0.3s; }
.sparkles span:nth-child(3) { animation-delay: 0.6s; }
.sparkles span:nth-child(4) { animation-delay: 0.9s; }

.processing-text {
    font-size: 1.2rem;
    color: #555;
    font-weight: bold;
}

/* Storybook Styles */
.storybook-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.storybook-header {
    text-align: center;
    margin-bottom: 30px;
}

.storybook-header h2 {
    font-family: 'sans-serif', Verdana;
    font-size: 2.2rem;
    color: #4a5568;
    margin-bottom: 20px;
}

.story-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.page-btn {
    background: linear-gradient(45deg, #7fb3d3, #95c5e1);
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(127, 179, 211, 0.4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-counter {
    font-weight: bold;
    color: #555;
    padding: 0 15px;
}

/* Story Pages */
.story-page {
    background: linear-gradient(135deg, #fdf6e3, #faeee0); /* soft beige + cream */
    border: 3px solid #f5c6aa;   /* warm pastel coral border */
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    min-height: 300px;
    display: none;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    overflow: hidden;
}

.story-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.15) 0%, transparent 70%),
                radial-gradient(circle, rgba(173, 216, 230, 0.15) 0%, transparent 70%),
                radial-gradient(circle, rgba(221, 160, 221, 0.15) 0%, transparent 70%);
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
}

.story-page.active {
    display: block;
}

.story-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

.page-number {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ffd700;
    color: #333;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.story-content {
    position: relative;
    z-index: 1;
}

.story-title {
    font-family: 'sans-serif', Verdana;
    font-size: 1.8rem;
    color: #d4691a;
    margin-bottom: 20px;
    text-align: center;
}

.story-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #333;
    text-align: justify;
}

.story-illustration {
    text-align: center;
    font-size: 4rem;
    margin: 20px 0;
}

/* Story Actions */
.story-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn {
    background: linear-gradient(45deg, #a8d8ea, #b8e6b8);
    color: white;
}

.new-btn {
    background: linear-gradient(45deg, #88d8c0, #a8e6cf);
    color: white;
}

.share-btn {
    background: linear-gradient(45deg, #7fb3d3, #95c5e1);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #2c5aa0;
    font-size: 1rem;
}

.storybook-collect-img {
    width: 100%;          /* spans the full container width */
    max-width: 800px;     /* optional: cap so it’s not too huge */
    height: auto;
    display: block;
    margin: 0 auto 30px;  /* center it with space below */
}

/* Back Button Styles */
.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 10px 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 20px 20px 20px;
    display: inline-block;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.app-title {
    font-family: 'sans-serif', Verdana;
    font-size: 2rem;
    color: #fff;
    text-align: center;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Story Cards */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.story-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.story-card:nth-child(1) {
    background: linear-gradient(135deg, #88d8c0, #7fb3d3);
    color: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.story-card:nth-child(2) {
    background: linear-gradient(135deg, #a8e6cf, #81c3d7);
    color: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.story-card:nth-child(3) {
    background: linear-gradient(135deg, #86b7df, #7fcdcd);
    color: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.story-card:nth-child(4) {
    background: linear-gradient(135deg, #4CAF50, #1abc9c);
    color: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-color: #4a90e2;
}

.story-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.story-card-header h3 {
    font-family: 'sans-serif', Verdana;
    color: #063cb4;
    margin: 0;
    font-size: 1.2rem;
}

.story-date {
    font-size: 0.9rem;
    color: #063cb4;
    background: linear-gradient(135deg, #88d8c0, #7fb3d3);
    padding: 4px 8px;
    border-radius: 10px;
}

.story-preview {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.story-preview-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: url("images/book.png") no-repeat center center;
    background-size: contain;
}

.story-preview-text {
    flex: 1;
    color: #063cb4;
    line-height: 1.4;
    margin: 0;
}

.story-stats {
    text-align: right;
    color: #063cb4;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #063cb4;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: 'sans-serif', Verdana;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #063cb4;
}

.empty-state p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.create-story-btn {
    background: linear-gradient(45deg, #66bb6a, #81c784);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-story-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 187, 106, 0.4);
}

/* Back to List Button */
.back-to-list-btn {
    background: rgba(74, 144, 226, 0.1);
    border: 2px solid #4a90e2;
    border-radius: 20px;
    padding: 8px 16px;
    color: #4a90e2;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-to-list-btn:hover {
    background: #4a90e2;
    color: white;
}

/* Delete Button */
.delete-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(45deg, #ff5252, #ff7979);
}

/* Action Buttons Spacing */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .design-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .left-content {
        max-width: 100%;
        padding: 40px 30px;
    }
    
    .right-content {
        max-width: 100%;
        padding: 20px;
    }
    
    .storywell-title {
        font-size: 3.5rem;
    }
    
    .wishing-well-svg {
        width: 280px;
        height: 320px;
        transform: none;
    }
    
    .top-stars {
        right: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .story-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .story-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 200px;
    }
}
