:root {
    /* New color palette inspired by the provided colors */
    --primary-color: 219 72% 56%; /* #3f75cf - Medium blue for primary actions */
    --secondary-color: 22 89% 57%; /* #ef823d - Soft tangerine for secondary elements */
    --success-color: 119 45% 40%; /* #418d3f - Leafy green for success states */
    --warning-color: 43 97% 59%; /* #fbb731 - Warm yellow for warnings */
    --danger-color: 6 78% 59%; /* #f04c3c - Vibrant red-orange for errors */
    --accent-color: 23 89% 57%; /* #f47d2f - Orange for highlights */
    --background: 30 35% 94%; /* #f5efe7 - Light beige/cream background */
    --surface: 0 0% 100%; /* #ffffff - Pure white for cards */
    --text-primary: 0 0% 4%; /* #0b0b0b - Deep black for text */
    --text-secondary: 220 9% 46%; /* #6c757d - Gray for secondary text */
    --text-charcoal: 0 0% 20%; /* #333333 - Charcoal black for form text */
    --gradient-start: 219 72% 56%; /* #3f75cf - Medium blue */
    --gradient-end: 22 89% 57%; /* #ef823d - Soft tangerine */
    --border-radius: 12px;
    --shadow: 0 10px 30px hsla(0, 0%, 4%, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--text-primary));
    line-height: 1.6;
}

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, hsl(var(--gradient-start)), hsl(var(--gradient-end)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header Emojis and Characters */
.header-emoji {
    font-size: 2rem;
    margin: 0 0.5rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

.header-emoji:first-child {
    animation-delay: 0.5s;
}

.header-emoji:last-child {
    animation-delay: 1s;
}

.header-characters {
    margin-top: 2rem;
    overflow: hidden;
}

.floating-char {
    display: inline-block;
    font-size: 1.5rem;
    margin: 0 1rem;
    animation: float 3s ease-in-out infinite;
    opacity: 0.7;
}

.floating-char:nth-child(1) { animation-delay: 0s; }
.floating-char:nth-child(2) { animation-delay: 0.6s; }
.floating-char:nth-child(3) { animation-delay: 1.2s; }
.floating-char:nth-child(4) { animation-delay: 1.8s; }
.floating-char:nth-child(5) { animation-delay: 2.4s; }

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, hsl(var(--primary-color)), hsl(var(--accent-color)));
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px hsla(220, 30%, 0%, 0.15);
}

/* Pitch Option Cards */
.pitch-option {
    height: 160px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 2px solid hsl(var(--text-charcoal) / 0.3);
    position: relative;
    overflow: hidden;
    background: hsl(var(--surface));
    box-shadow: 0 4px 12px hsla(0, 0%, 4%, 0.08);
}

.pitch-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px hsla(0, 0%, 4%, 0.15);
    border-color: hsl(var(--text-charcoal));
}

.btn-check:checked + .pitch-option {
    background: hsl(var(--primary-color));
    color: white;
    border-color: hsl(var(--primary-color));
    transform: translateY(-4px);
    box-shadow: 0 12px 30px hsla(var(--primary-color), 0.4);
}

.btn-check:checked + .pitch-option .pitch-text,
.btn-check:checked + .pitch-option .pitch-subtitle {
    color: white !important;
}

.pitch-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: wiggle 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.pitch-text {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.pitch-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

/* Form Controls */
.form-control,
.form-select {
    border: 2px solid hsl(var(--primary-color) / 0.1);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
    color: hsl(var(--text-charcoal));
}

.form-control:focus,
.form-select:focus {
    border-color: hsl(var(--primary-color));
    box-shadow: 0 0 0 0.2rem hsla(var(--primary-color), 0.25);
    color: hsl(var(--text-charcoal));
}

.form-floating > label {
    color: hsl(var(--text-secondary));
}

.form-select option {
    color: hsl(var(--text-charcoal));
}

/* Custom text colors */
.text-dark {
    color: hsl(var(--text-charcoal)) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary-color)), hsl(var(--accent-color)));
    color: white;
    padding: 0.75rem 2rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, hsl(var(--accent-color)), hsl(var(--primary-color)));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px hsla(var(--primary-color), 0.3);
}

/* Generate Button */
.generate-btn {
    position: relative;
    overflow: hidden;
}

.btn-emoji {
    font-size: 1.2rem;
    margin: 0 0.5rem;
    display: inline-block;
    animation: spin 4s linear infinite;
}

.btn-emoji:first-child {
    animation: pulse 2s ease-in-out infinite;
}

.btn-emoji:last-child {
    animation: sparkle 3s ease-in-out infinite;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.rounded-pill {
    border-radius: 50px !important;
}

/* Result Cards */
.result-card {
    animation: slideInUp 0.6s ease-out;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.result-card:hover::before {
    left: 100%;
}

.result-card .card-header {
    font-weight: 600;
    border: none;
    padding: 1rem 1.5rem;
    position: relative;
}

.result-card .card-body {
    padding: 1.5rem;
}

.result-card .card-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: hsl(var(--text-primary));
}

.result-emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    animation: bounce 2s infinite;
}

/* Copy Buttons */
.copy-btn {
    transition: var(--transition);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(220, 30%, 0%, 0.15);
}

.copy-btn.copied {
    background-color: hsl(var(--success-color)) !important;
    border-color: hsl(var(--success-color)) !important;
    color: white !important;
}

/* Loading State */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

.loading-animation {
    position: relative;
    margin-bottom: 2rem;
}

.loading-emoji {
    font-size: 4rem;
    animation: rotate 2s linear infinite;
    margin-bottom: 1rem;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.loading-dots span {
    font-size: 2rem;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

.loading-messages {
    opacity: 0.8;
}

.loading-messages small {
    animation: fadeInOut 2s ease-in-out infinite;
    margin: 0.25rem 0;
}

.loading-messages small:nth-child(1) { animation-delay: 0s; }
.loading-messages small:nth-child(2) { animation-delay: 0.7s; }
.loading-messages small:nth-child(3) { animation-delay: 1.4s; }

.error-emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -7px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

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

@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

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

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.alert-danger {
    background-color: hsla(var(--danger-color), 0.1);
    color: hsl(var(--danger-color));
    border-left: 4px solid hsl(var(--danger-color));
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card-body {
        padding: 2rem 1.5rem;
    }
    
    .pitch-option {
        height: 120px;
        font-size: 0.9rem;
    }
    
    .pitch-emoji {
        font-size: 2rem !important;
    }
    
    .pitch-text {
        font-size: 0.9rem;
    }
    
    .pitch-subtitle {
        font-size: 0.75rem;
    }
    
    .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .header-emoji {
        font-size: 1.5rem;
    }
    
    .floating-char {
        font-size: 1.2rem;
        margin: 0 0.5rem;
    }
    
    .loading-emoji {
        font-size: 3rem;
    }
    
    .result-emoji {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .btn-lg {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .result-card .card-text {
        font-size: 1rem;
    }
    
    .pitch-option {
        height: 110px;
        margin-bottom: 1rem;
    }
    
    .pitch-emoji {
        font-size: 1.8rem !important;
    }
    
    .pitch-text {
        font-size: 0.85rem;
    }
    
    .pitch-subtitle {
        font-size: 0.7rem;
    }
    
    .btn-emoji {
        font-size: 1rem;
        margin: 0 0.25rem;
    }
    
    .header-characters {
        margin-top: 1rem;
    }
    
    .floating-char {
        font-size: 1rem;
        margin: 0 0.25rem;
    }
    
    .loading-animation {
        margin-bottom: 1rem;
    }
    
    .loading-emoji {
        font-size: 2.5rem;
    }
    
    .loading-messages small {
        font-size: 0.8rem;
    }
    
    .col-md-4 {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 400px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .pitch-option {
        height: 100px;
    }
    
    .pitch-emoji {
        font-size: 1.5rem !important;
    }
    
    .pitch-text {
        font-size: 0.8rem;
    }
    
    .pitch-subtitle {
        font-size: 0.65rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1.5rem 1rem;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.btn-check:focus + .pitch-option {
    outline: 2px solid hsl(var(--primary-color));
    outline-offset: 2px;
}

/* Hover Effects */
.card:hover .card-header {
    background: linear-gradient(135deg, currentColor, currentColor) !important;
}

/* Custom Select Styles */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

/* Additional Spacing */
.mb-5 {
    margin-bottom: 3rem !important;
}

/* Footer */
footer {
    background: hsl(var(--background));
    border-top: 1px solid hsl(var(--primary-color) / 0.1);
}

.creator-info {
    margin-top: 1rem;
    padding: 1rem;
    background: hsl(var(--surface));
    border-radius: var(--border-radius);
    border: 1px solid hsl(var(--secondary-color) / 0.2);
    box-shadow: 0 4px 12px hsla(0, 0%, 4%, 0.05);
}

.creator-info a {
    color: hsl(var(--primary-color));
    font-weight: 600;
    transition: var(--transition);
}

.creator-info a:hover {
    color: hsl(var(--gradient-end));
    text-decoration: underline !important;
}

/* Action Buttons */
.start-fresh-btn {
    border: 2px solid hsl(var(--primary-color));
    color: hsl(var(--primary-color));
    transition: var(--transition);
}

.start-fresh-btn:hover {
    background: hsl(var(--primary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(var(--primary-color), 0.3);
}

.try-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(220, 30%, 0%, 0.15);
}
