/* Chortle v5.3 - Component Styles */
/* Buttons, forms, wizard, share page, and loading states */

/* Wizard */
.wizard-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    padding-top: 30px;
}

.wizard-header h2 {
    display: none; /* Hide "Fill Out Your Chortle" */
}

.wizard-back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 10px;
    transition: all 0.2s ease;
}

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

.wizard-header .template-name {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em; /* Make it the main title */
    margin-bottom: 0;
}

.progress-fill {
    background: #00BBF9; /* Solid blue instead of gradient */
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.wizard-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

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

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

.step-content {
    text-align: center;
    margin: 30px 0; /* Reduced from 40px 0 */
}

.step-question {
    font-size: 1.2em; /* Reduced from 1.4em */
    color: #4a5568;
    margin-bottom: 20px; /* Reduced from 25px */
    font-weight: 600;
}

.step-input {
    width: 100%;
    max-width: 400px;
    padding: 18px; /* Reduced from 20px */
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    font-size: 1.1em; /* Reduced from 1.2em */
    font-family: inherit;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box; /* Fix for margin issue */
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px; /* Reduced from 40px */
    gap: 15px; /* Reduced from 20px */
}

.nav-btn {
    padding: 12px 20px; /* Reduced from 15px 30px */
    border: none;
    border-radius: 12px;
    font-size: 1em; /* Reduced from 1.1em */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.btn-back {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #2D3748 !important;
    border: 3px solid #cbd5e0 !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 4px 0 #a0aec0, 0 6px 12px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
    text-shadow: none !important;
    flex: 0 0 25%; /* Take up 25% width */
}

.btn-back:hover {
    background: linear-gradient(180deg, #f7fafc 0%, #e2e8f0 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #a0aec0, 0 10px 18px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
}

.btn-back:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 0 #a0aec0, 0 3px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
}

.btn-next {
    flex: 1; /* Take up remaining 75% width */
}

/* Primary CTA Button */
.primary-btn {
    background: linear-gradient(180deg, #00D4FF 0%, #00BBF9 50%, #0099CC 100%) !important;
    color: white !important;
    border: 3px solid #0088BB !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 6px 0 #0077AA, 0 8px 15px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
    font-family: 'Outfit', sans-serif !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.primary-btn:hover {
    background: linear-gradient(180deg, #00E6FF 0%, #00D4FF 50%, #00BBF9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 0 #0077AA, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

.primary-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #0077AA, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Secondary CTA Button */
.secondary-btn {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #2D3748 !important;
    border: 3px solid #cbd5e0 !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 4px 0 #a0aec0, 0 6px 12px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
    text-shadow: none !important;
}

.secondary-btn:hover {
    background: linear-gradient(180deg, #f7fafc 0%, #e2e8f0 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #a0aec0, 0 10px 18px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
}

.secondary-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 0 #a0aec0, 0 3px 8px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.8) !important;
}

/* Apply primary button styles to existing CTA buttons */
.btn-next,
.share-btn,
.video-btn.primary-btn,
.copy-btn,
.create-new-btn {
    background: linear-gradient(180deg, #00D4FF 0%, #00BBF9 50%, #0099CC 100%) !important;
    color: white !important;
    border: 3px solid #0088BB !important;
    padding: 15px 30px !important;
    border-radius: 50px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 6px 0 #0077AA, 0 8px 15px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
    font-family: 'Outfit', sans-serif !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
    margin: 0 auto !important;
}

.btn-next:hover,
.share-btn:hover,
.video-btn.primary-btn:hover,
.copy-btn:hover,
.create-new-btn:hover {
    background: linear-gradient(180deg, #00E6FF 0%, #00D4FF 50%, #00BBF9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 0 #0077AA, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-next:active,
.share-btn:active,
.video-btn.primary-btn:active,
.copy-btn:active,
.create-new-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #0077AA, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

.template-btn-icon {
    text-align: center;
    margin-bottom: 15px;
    display: block;
}

.template-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: opacity(0.8);
    transition: all 0.3s ease;
    margin-top: 2px; /* Slight offset to align with title */
}

.template-btn:hover .template-icon-img {
    filter: opacity(1);
    transform: scale(1.05);
}

/* Disabled State */
.primary-btn:disabled,
.secondary-btn:disabled,
.btn-next:disabled,
.share-btn:disabled,
.video-btn.primary-btn:disabled,
.copy-btn:disabled,
.create-new-btn:disabled {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e0 50%, #a0aec0 100%) !important;
    color: #718096 !important;
    border: 3px solid #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
    transition: none !important;
    box-shadow: 0 3px 0 #9ca3af, 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
    text-shadow: none !important;
    opacity: 0.7 !important;
}

.primary-btn:disabled:hover,
.secondary-btn:disabled:hover,
.btn-next:disabled:hover,
.share-btn:disabled:hover,
.video-btn.primary-btn:disabled:hover,
.copy-btn:disabled:hover,
.create-new-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 3px 0 #9ca3af, 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Share Page */
.ready-content {
    text-align: center;
}

.ready-content h2 {
    color: #2D3748;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 700;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-out;
}

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

.share-instructions {
    background: rgba(0, 187, 249, 0.1);
    border-radius: 20px;
    padding: 15px 25px;
    margin: 25px 0;
    border-left: none;
}

.share-step {
    display: flex;
    align-items: flex-start;
    margin: 15px 0;
    font-size: 1em;
    font-weight: 500;
    gap: 15px;
    text-align: left;
}

.share-step-text {
    flex: 1;
    line-height: 1.4;
    padding-top: 2px; /* Align with number circle */
    text-align: left;
}

.share-step-number {
    background: #00BBF9;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: none;
}

.share-btn {
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.3em;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    width: 100%;
    margin: 20px 0;
}

.link-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    display: none;
}

.link-section.active {
    display: block;
}

.link-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.link-input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: white;
    color: #2D3748;
}

.copy-btn {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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