/**
 * Fairy Tale Club Plugin Styles
 * Modern, beautiful UI for the story creation wizard and interactive elements
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.ftc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ftc-wizard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

/* ==========================================================================
   Step Indicators
   ========================================================================== */

.ftc-step-indicators {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}

.ftc-step-indicator {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px 20px;
    margin: 0 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.ftc-step-indicator:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.ftc-step-indicator.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ftc-step-indicator.completed {
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.ftc-step-indicator::before {
    content: attr(data-step);
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.ftc-step-indicator.active::before {
    background: #667eea;
    color: white;
}

.ftc-step-indicator.completed::before {
    background: white;
    color: #4caf50;
}

/* ==========================================================================
   Step Content
   ========================================================================== */

.ftc-step {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: none;
}

.ftc-step:first-child {
    display: block;
}

.ftc-step-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ftc-step-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

/* ==========================================================================
   Character Form
   ========================================================================== */

.ftc-character-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.ftc-form-group {
    margin-bottom: 25px;
}

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

.ftc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.ftc-form-group input,
.ftc-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.ftc-form-group input:focus,
.ftc-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ftc-form-group input.error,
.ftc-form-group select.error {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.ftc-character-preview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
}

.ftc-character-preview .name {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.ftc-character-preview .description {
    font-size: 1.2em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.ftc-character-preview .appearance {
    font-size: 1em;
    opacity: 0.8;
}

/* ==========================================================================
   Concept Selection
   ========================================================================== */

.ftc-concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.ftc-concept-card {
    background: white;
    border: 3px solid #e1e5e9;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ftc-concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ftc-concept-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.ftc-concept-card:hover::before {
    transform: scaleX(1);
}

.ftc-concept-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ftc-concept-card.selected::before {
    transform: scaleX(1);
}

.ftc-concept-card .concept-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.ftc-concept-card.selected .concept-title {
    color: white;
}

.ftc-concept-card .concept-synopsis {
    color: #666;
    line-height: 1.6;
}

.ftc-concept-card.selected .concept-synopsis {
    color: rgba(255, 255, 255, 0.9);
}

.ftc-concept-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
    display: none;
}

.ftc-concept-preview .title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 15px;
}

.ftc-concept-preview .synopsis {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ==========================================================================
   Personalization Form
   ========================================================================== */

.ftc-personalization-form {
    max-width: 600px;
    margin: 0 auto;
}

.ftc-gift-note {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   Story Preview
   ========================================================================== */

.ftc-story-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin: 30px 0;
    display: none;
}

.ftc-story-preview .title {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 20px;
}

.ftc-story-preview .content {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 25px;
    opacity: 0.9;
}

.ftc-story-preview .page-count {
    font-size: 1em;
    opacity: 0.8;
    font-style: italic;
}

/* ==========================================================================
   Navigation Buttons
   ========================================================================== */

.ftc-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.ftc-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.ftc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ftc-prev-btn {
    background: #6c757d;
    color: white;
}

.ftc-prev-btn:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.ftc-next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ftc-next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.ftc-submit-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    font-size: 18px;
    padding: 18px 40px;
}

.ftc-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* ==========================================================================
   Story Segment Display
   ========================================================================== */

.ftc-story-segment {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

.ftc-segment-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
}

.ftc-segment-content {
    font-size: 1.2em;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
    text-align: justify;
}

.ftc-choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.ftc-branch-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.ftc-branch-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* ==========================================================================
   Loading and Notifications
   ========================================================================== */

.ftc-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.ftc-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.ftc-error,
.ftc-success {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.ftc-error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.ftc-success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ftc-container {
        padding: 15px;
    }
    
    .ftc-wizard {
        padding: 20px 15px;
    }
    
    .ftc-step {
        padding: 25px 20px;
    }
    
    .ftc-step-title {
        font-size: 2em;
    }
    
    .ftc-character-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ftc-concepts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ftc-step-indicators {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ftc-step-indicator {
        margin: 0 5px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .ftc-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .ftc-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .ftc-choices-container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .ftc-step-title {
        font-size: 1.8em;
    }
    
    .ftc-step {
        padding: 20px 15px;
    }
    
    .ftc-character-preview,
    .ftc-concept-preview,
    .ftc-story-preview {
        padding: 20px;
    }
    
    .ftc-character-preview .name {
        font-size: 1.6em;
    }
    
    .ftc-concept-card {
        padding: 20px;
    }
    
    .ftc-concept-card .concept-title {
        font-size: 1.2em;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ftc-wizard,
    .ftc-navigation,
    .ftc-loading,
    .ftc-error,
    .ftc-success {
        display: none !important;
    }
    
    .ftc-story-segment {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ftc-segment-content {
        font-size: 14pt;
        line-height: 1.6;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.ftc-btn:focus,
.ftc-concept-card:focus,
.ftc-step-indicator:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.ftc-form-group input:focus,
.ftc-form-group select:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ftc-wizard {
        background: #000;
    }
    
    .ftc-step {
        border: 2px solid #000;
    }
    
    .ftc-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ftc-btn,
    .ftc-concept-card,
    .ftc-step-indicator,
    .ftc-branch-btn {
        transition: none;
    }
    
    .ftc-loading .spinner {
        animation: none;
    }
    
    .ftc-error,
    .ftc-success {
        animation: none;
    }
}
