/* Story Outline CSS - Visual and UX improvements */

/* Main layout and containers */
.section-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.section-header h3 {
    margin: 0;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
}

.section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    padding: 1rem 0;
}

.section-card.collapsed .section-content {
    max-height: 0;
    padding: 0;
}

/* Redesigned buttons */
.button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
    position: relative;
    overflow: hidden;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(59, 130, 246, 0.3);
}

.button-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 3px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    transform: none;
    box-shadow: none;
}

/* Button ripple effect */
.button-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.button-primary:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

.button-secondary {
    background: white;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    font-weight: 600;
    padding: 9px 19px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.button-secondary:hover {
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Chapter cards */
.chapter-card {
    background: white;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
    padding: 16px;
    transition: all 0.3s ease;
}

.chapter-card:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.chapter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.chapter-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chapter-card-actions {
    display: flex;
    gap: 8px;
}

.chapter-card-content {
    color: #475569;
    line-height: 1.6;
}

/* Button styles for chapter actions */
.regenerate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.regenerate-btn:hover {
    transform: translateY(-1px);
}

.edit-chapter-btn {
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-chapter-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.delete-chapter-btn {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-chapter-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

/* Improved textarea styling */
textarea {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) inset;
}

textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* Final outline container styling */
#final-outline-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Responsive layout improvements */
@media (max-width: 768px) {
    .chapter-card-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .chapter-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Card for final outline */
.final-outline-header {
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e5e9f2;
}

.final-outline-header h3 {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

/* Expand/collapse all button */
.expand-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    color: #3b82f6;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-collapse-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.expand-collapse-btn i {
    width: 16px;
    height: 16px;
}

/* Progress steps */
.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-text {
    font-size: 0.875rem;
    color: #475569;
}

.active-step .step-number {
    background: #10b981;
}

.active-step .step-text {
    font-weight: 600;
    color: #1e293b;
}

/* Base styles */
body {
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
}

/* Glassmorphism effect */
.glassmorphism {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
}

.glassmorphism:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

#loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeIn 0.5s ease-out;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 0;
    font-weight: 500;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

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

/* Animation classes */
.float {
    animation: float 3s ease-in-out infinite;
}

.sparkle {
    animation: sparkle 2s ease-in-out infinite;
}

/* Hover effects */
.pulse-on-hover {
    transition: transform 0.2s ease-in-out;
}

.pulse-on-hover:hover {
    transform: scale(1.05);
}

.sparkle-on-hover {
    transition: transform 0.2s ease-in-out;
}

.sparkle-on-hover:hover {
    transform: scale(1.1);
}

/* Icon styles */
.feather-icon {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.feather-icon:hover {
    transform: scale(1.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Modal styles */
#edit-chapter-modal {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

#edit-chapter-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#edit-chapter-modal .glassmorphism {
    animation: modalFadeIn 0.3s ease-in-out;
    background: white;
    backdrop-filter: none;
    border: 1px solid rgba(226, 232, 240, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#edit-chapter-modal textarea {
    resize: vertical;
    min-height: 150px;
    max-height: 400px;
    font-size: 1rem;
    line-height: 1.5;
}

#edit-chapter-modal textarea:focus,
#edit-chapter-modal input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    outline: none;
    border-color: #3b82f6;
}

/* Add some nice transition for the modal buttons */
#edit-chapter-modal button {
    transition: all 0.2s ease;
}

#edit-chapter-modal button:hover {
    transform: translateY(-2px);
}

#edit-chapter-modal button:active {
    transform: translateY(1px);
}

#edit-chapter-modal #cancel-edit-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* Make sure the modal has a higher z-index than the loading overlay */
#edit-chapter-modal {
    z-index: 10000;
}

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

.animate-fade-in-on-load {
  opacity: 0; /* Start hidden */
  animation: fadeIn 0.7s ease-out forwards;
  animation-delay: 0.2s;
} 