/* Create Mystery Page Styles - Light Writer Theme */

/* Custom Font Integration */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* Override dark theme with light writer theme */
body {
    overflow: auto !important;
}

.container {
    background: #f8f6f2;
    color: #2c2419;
    min-height: 100vh;
    font-family: 'Crimson Text', serif;
    overflow-y: auto;
}

header {
    background: #ffffff;
    border-bottom: 2px solid #d4af37;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header h1 {
    font-family: 'FBRemington', serif;
    color: #8b4513;
    font-size: 2.2rem;
    font-weight: normal;
}

/* Progress Steps - Writer Theme */
.progress-container {
    margin: 3rem auto;
    max-width: 1200px;
    padding: 0 2rem;
}

.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: #d4af37;
    transform: translateY(-50%);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 50px;
    height: 50px;
    background: #ffffff;
    color: #8b4513;
    border: 3px solid #d4af37;
    font-family: 'FBRemington', serif;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.step.active .step-number {
    background: #d4af37;
    color: #ffffff;
    border-color: #d4af37;
}

.step.completed .step-number {
    background: #8b4513;
    color: #ffffff;
    border-color: #8b4513;
}

.step-title {
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-size: 1rem;
    font-weight: bold;
}

.step.active .step-title {
    color: #d4af37;
}

.step.completed .step-title {
    color: #8b4513;
}

/* Step Content - Wider Layout */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    max-height: none;
    overflow: visible;
}

.step-content.active {
    display: block;
}

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

/* Form Card - Light Theme */
.form-card {
    background: #ffffff;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-width: none;
}

.form-card h2 {
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: normal;
}

.step-description {
    color: #6b5b73;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    font-style: italic;
}

/* Form Layout - Two Column */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #faf9f7;
    border: 2px solid #e8dcc0;
    border-radius: 8px;
    color: #2c2419;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #d4af37;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Crimson Text', serif;
    line-height: 1.6;
}

/* Suspects Section */
.suspects-section {
    margin-top: 2rem;
}

.suspects-container {
    border: 2px solid #e8dcc0;
    border-radius: 8px;
    padding: 1.5rem;
    background: #faf9f7;
    margin-top: 1rem;
}

.suspect-card {
    background: #ffffff;
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.suspect-card:last-child {
    margin-bottom: 0;
}

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

.suspect-number {
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-size: 1.2rem;
    font-weight: bold;
}

.suspect-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guilty-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-weight: bold;
}

.guilty-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.remove-suspect {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-suspect:hover {
    background: #c82333;
}

.suspect-fields {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

.suspect-fields .motive-field {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.motive-field label {
    color: #d4af37;
    font-weight: bold;
}

.motive-field input {
    border: 2px solid #d4af37;
    background: #fff8e1;
}

.add-suspect-btn {
    background: #8b4513;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-family: 'FBRemington', serif;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-suspect-btn:hover {
    background: #6d3410;
    transform: translateY(-1px);
}

/* Credits Info - Light Theme */
.credits-info {
    background: #fff8e1;
    border: 2px solid #d4af37;
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-weight: bold;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.credits-info.loading {
    color: #d4af37;
    background: #fff8e1;
    border-color: #d4af37;
}

.credits-info.error {
    color: #dc3545;
    background: #fff5f5;
    border-color: #dc3545;
}

.credits-info.unauthenticated {
    color: #6c757d;
    background: #f8f9fa;
    border-color: #6c757d;
}

.credits-info.no-credits {
    color: #fd7e14;
    background: #fff8f0;
    border-color: #fd7e14;
}

/* Button Styles - Writer Theme */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-family: 'FBRemington', serif;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #d4af37;
    color: #ffffff;
    border: 2px solid #d4af37;
}

.btn-primary:hover {
    background: #b8941f;
    border-color: #b8941f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
    background: #bbb;
    border-color: #bbb;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #ffffff;
    color: #8b4513;
    border: 2px solid #8b4513;
}

.btn-secondary:hover {
    background: #8b4513;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Generate Button Special Styling */
#generateBtn {
    width: 100%;
    max-width: 300px;
    margin: 2rem auto 0;
    display: flex;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
}

/* Back Button */
.back-btn {
    background: #ffffff;
    color: #8b4513;
    border: 2px solid #8b4513;
    font-family: 'FBRemington', serif;
    font-weight: bold;
}

.back-btn:hover {
    background: #8b4513;
    color: #ffffff;
}

/* Mystery Preview - Light Theme */
.mystery-preview {
    background: #faf9f7;
    border: 2px solid #e8dcc0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.mystery-section {
    margin-bottom: 2.5rem;
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e8dcc0;
}

.section-title {
    color: #8b4513;
    font-family: 'FBRemington', serif;
    font-size: 1.3rem;
    font-weight: bold;
}

.edit-btn {
    background: #d4af37;
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.edit-btn:hover {
    background: #b8941f;
}

.section-content {
    color: #2c2419;
    line-height: 1.7;
}

/* Modal Styles - Light Theme */
.modal {
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: #ffffff;
    border: 2px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
}

.modal-header h3 {
    color: #8b4513;
    font-family: 'FBRemington', serif;
}

.modal-close {
    color: #8b4513;
}

.modal-close:hover {
    color: #d4af37;
}

.modal-body {
    padding: 2rem;
}

.modal-body textarea {
    min-height: 300px;
    font-size: 1rem;
    line-height: 1.6;
    font-family: 'Crimson Text', serif;
}

/* Success Card Redesign */
.success-card {
    text-align: center;
    background: #f8fff4;
    border-color: #28a745;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    color: #28a745;
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.success-card h2 {
    color: #8b4513;
    margin-bottom: 1rem;
}

.success-description {
    color: #6b5b73;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    font-style: italic;
}

/* Share Section Redesign */
.share-section {
    margin: 2.5rem 0;
}

.share-url-display {
    background: #faf9f7;
    border: 2px solid #e8dcc0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    color: #8b4513;
    font-size: 0.9rem;
    line-height: 1.4;
}

.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-share {
    flex: 1;
    max-width: 200px;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
}

.btn-copy {
    background: #8b4513;
    color: #ffffff;
    border: 2px solid #8b4513;
}

.btn-copy:hover {
    background: #6d3410;
    border-color: #6d3410;
}

.btn-native-share {
    background: #d4af37;
    color: #ffffff;
    border: 2px solid #d4af37;
}

.btn-native-share:hover {
    background: #b8941f;
    border-color: #b8941f;
}

/* Success Footer */
.success-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e8dcc0;
}

.create-another {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.back-home {
    background: none;
    border: none;
    color: #8b4513;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.back-home:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Loading Overlay - Enhanced Light Theme */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 246, 242, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    background: #ffffff;
    border: 2px solid #d4af37;
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.loading-spinner i {
    font-size: 3rem;
    color: #d4af37;
    animation: magic-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
    position: relative;
    z-index: 2;
}

/* Sparkles around the magic wand */
.sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: sparkle 3s ease-in-out infinite;
}

.sparkle-1 {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 70%;
    right: 15%;
    animation-delay: 1s;
}

.sparkle-3 {
    bottom: 20%;
    left: 60%;
    animation-delay: 2s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes magic-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(-5deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.1) rotate(3deg);
        opacity: 1;
    }
}

.loading-content p {
    color: #8b4513;
    font-family: 'Crimson Text', serif;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
}

/* Add a pulsing animation to the loading text */
.loading-content p {
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

/* Publish Warning - Light Theme */
.publish-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #8b4513;
}

.publish-warning i {
    color: #ffc107;
}

input::placeholder,
    textarea::placeholder {
      color: rgba(0, 0, 0, 0.4);
    }

    input::-webkit-input-placeholder,
    textarea::-webkit-input-placeholder {
      color: rgba(0, 0, 0, 0.4);
    }
    
/* Auth Modal - Force Dark Theme (Override Light Theme) */
.auth-modal {
    /* Force dark background for auth modal */
    background: rgba(0, 0, 0, 0.8) !important;
}

.auth-modal-content {
    background: #2a2a2a !important;
    border: 2px solid #d4af37 !important;
    color: #e0b47a !important;
}

.auth-title {
    color: #d4af37 !important;
    font-family: 'FBRemington', serif !important;
    text-align: center !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.8rem !important;
}

.auth-subtitle {
    color: #e0b47a !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
    opacity: 0.9 !important;
    font-size: 1rem !important;
}

.oauth-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.oauth-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1.5rem !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#googleSignIn {
    background: #4285f4 !important;
    color: white !important;
}

#googleSignIn:hover {
    background: #357ae8 !important;
    transform: translateY(-1px) !important;
}

#appleSignIn {
    background: #000 !important;
    color: white !important;
}

#appleSignIn:hover {
    background: #333 !important;
    transform: translateY(-1px) !important;
}

.oauth-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.auth-close-button {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background: transparent !important;
    border: none !important;
    color: #e0b47a !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    line-height: 1 !important;
    transition: color 0.3s ease !important;
}

.auth-close-button:hover {
    color: #d4af37 !important;
}

.error-message {
    background: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px !important;
    margin: 1rem 0 !important;
    font-size: 0.9rem !important;
    text-align: center !important;
}

.auth-disclaimer {
    text-align: center !important;
    font-size: 0.8rem !important;
    color: #888 !important;
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #444 !important;
}

/* Credits display clickable link styling */
.credits-info.unauthenticated a {
    color: #d4af37 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

.credits-info.unauthenticated a:hover {
    color: #f4e67d !important;
    text-decoration: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .suspect-fields {
        grid-template-columns: 1fr;
    }
    
    .form-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .step-content {
        padding: 1rem;
    }
    
    .step-actions {
        flex-direction: column;
        align-items: center;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    /* Mobile Success Page */
    .share-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-share {
        max-width: none;
        width: 100%;
    }
    
    .success-icon {
        font-size: 3rem;
    }
    
    .share-url-display {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}
