/* Story Complete Page Styles */
.story-complete-container {
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Story Header */
.story-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.story-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.story-title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.story-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.story-title:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--highlight-color);
}

.edit-title-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.edit-title-btn:hover {
    color: var(--accent-color);
}

/* Story Actions */
.story-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--highlight-color);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-color);
    color: var(--surface-color);
}

.action-btn i {
    font-size: 1.2rem;
}

.share-btn {
    background-color: var(--secondary-color);
    color: var(--surface-color);
    border-radius: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.share-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.create-story-btn {
    background-color: var(--accent-color);
    color: var(--surface-color);
    border-radius: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.create-story-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.my-stories-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border-radius: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.my-stories-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.like-btn.liked {
    background: var(--accent-color);
    color: var(--surface-color);
}

/* Story Steps */
.story-steps {
    max-width: 800px;
    margin: 0 auto;
}

.story-step {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 25px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.story-step-number {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.story-step-image {
    width: 100%;
    max-width: 768px;
    height: auto;
    display: block;
    aspect-ratio: 768/448;
    border-radius: 15px;
    margin: 0 auto 1.5rem;
}

.story-step-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.story-step-choice {
    background: var(--highlight-color);
    padding: 1rem;
    border-radius: 15px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.story-step-choice i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .story-actions,
    .edit-title-btn {
        display: none !important;
    }

    .story-complete-container {
        padding: 0;
        background: none;
    }

    .story-header,
    .story-step {
        box-shadow: none;
        padding: 0;
        margin-bottom: 2rem;
    }

    .story-title {
        border: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .story-complete-container {
        padding: 6rem 1rem 2rem;
    }

    .story-header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .story-title {
        font-size: 1.8rem;
    }

    .story-header-content {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.2rem;
    }

    .story-title-container {
        width: 100%;
        margin-bottom: 1rem;
    }

    .story-actions {
        width: 100%;
        gap: 0.8rem;
    }

    .action-btn {
        flex: 1 0 calc(50% - 0.4rem);
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
        min-width: unset;
    }

    .action-btn i {
        font-size: 1rem;
    }

    .story-step {
        padding: 1.5rem;
    }

    .story-step-image {
        max-width: 100%;
    }
}

/* Thank You Section */
.thank-you-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.thank-you-section h2 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-family);
}

.thank-you-section p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-family: var(--font-family);
    line-height: 1.6;
}

.thank-you-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.create-new-btn {
    background-color: var(--accent-color);
    color: var(--surface-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    text-decoration: none;
}

.create-new-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.create-new-btn i {
    font-size: 1rem;
}

.share-story-btn {
    background-color: var(--secondary-color);
    color: var(--surface-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.share-story-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-story-btn i {
    font-size: 1rem;
}

.thank-you-actions .action-btn {
    /* Button specific styles are now in the create-new-btn and share-story-btn classes */
    margin: 0.5rem;
}

@media (max-width: 768px) {
    .thank-you-section {
        margin: 1rem;
        padding: 1.5rem;
    }

    .thank-you-section h2 {
        font-size: 1.5rem;
    }

    .thank-you-section p {
        font-size: 1rem;
    }

    .thank-you-actions {
        flex-direction: column;
    }

    .thank-you-actions .action-btn {
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-phrase {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

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

/* Empty story message */
.empty-story {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin: 20px 0;
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

.toast.warning {
    background-color: #ff9800;
}

/* Login Section Styles */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
    margin-top: calc(-1 * var(--navbar-height)); /* Offset the navbar height */
}

.login-content {
    text-align: center;
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    transform: translateY(40px); /* Fine-tune vertical position */
}

.login-content i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.login-content h2 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.login-content p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

#btn-login-story-complete {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

#btn-login-story-complete i {
    font-size: 1.1rem;
    margin: 0;
}

/* Mobile Responsiveness for Login Section */
@media (max-width: 768px) {
    .login-content {
        padding: 2rem;
        transform: translateY(0);
    }
    
    .login-content h2 {
        font-size: 1.5rem;
    }
    
    .login-content p {
        font-size: 1rem;
    }
}

/* Show/hide sections based on auth state */
.logged-in-only {
    display: none;
}

.logged-out-only {
    display: block;
}

body.logged-in .logged-in-only {
    display: block;
}

body.logged-in .logged-out-only {
    display: none;
}

/* Previously hiding these elements for unauthenticated users - now showing for all */
/* 
body:not(.logged-in) .story-header-content,
body:not(.logged-in) .thank-you-section,
body:not(.logged-in) .story-actions {
    display: none;
}
*/

/* Share popup */
.share-popup {
    position: absolute;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    animation: fadeIn 0.2s ease-in-out;
}

.share-popup-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.share-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.share-option:hover {
    background-color: #f1f1f1;
}

.share-option i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.whatsapp-share i {
    color: #25D366;
}

.facebook-share i {
    color: #1877F2;
}

.copy-link i {
    color: #555;
}

/* For RTL language support */
html[dir="rtl"] .share-option {
    text-align: right;
}

html[dir="rtl"] .share-option i {
    margin-right: 0;
    margin-left: 12px;
}

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