/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Variables for Brand Colors */
:root {
    --primary-color: #FF6B6B;      /* Warm coral */
    --secondary-color: #4ECDC4;    /* Soft teal */
    --background-color: #FAFAFA;   /* Off-white */
    --text-color: #2C3E50;         /* Dark slate */
    --accent-color: #FFE66D;       /* Sunny yellow */
    --success-color: #51CF66;      /* Gentle green */
    --border-radius: 12px;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Custom Bootstrap Overrides */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover, 
.btn-primary:focus,
.btn-primary:active {
    background-color: #e55a5a;
    border-color: #e55a5a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #45b7b0;
    border-color: #45b7b0;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #48c05f;
    border-color: #48c05f;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-height: 56px;
}

/* Form Controls */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.15);
}

.form-label {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* Main Card */
.story-creator-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-medium);
    max-width: 100%;
    margin: 1rem;
}

/* Logo and Header */
.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feather-lg {
    width: 40px;
    height: 40px;
    color: white;
}

.feather-xl {
    width: 64px;
    height: 64px;
}

.feather-sm {
    width: 18px;
    height: 18px;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: 10%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
    transform: translateX(-50%);
    width: 60%;
}

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

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
}

.step.completed .step-label {
    color: var(--success-color);
}

/* Input Sections */
.input-section {
    transition: var(--transition);
}

.btn-group .btn-check:checked + .btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Story Display */
.story-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.story-title {
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.story-content {
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
}

/* Success Message */
.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color), #48c05f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.text-success {
    color: var(--success-color) !important;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Loading Spinners */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .story-creator-card {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 16px;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .progress-steps {
        margin-bottom: 1.5rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .progress-steps::before {
        width: 50%;
    }
}

@media (max-width: 576px) {
    .story-creator-card {
        padding: 1rem;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    
    .feather-lg {
        width: 32px;
        height: 32px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius) !important;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

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

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

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #d63384;
        --secondary-color: #198754;
        --text-color: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
