/**
 * Knitting Pattern Page - Bundle-First Design
 * Beginner-Friendly, Conversion-Optimized, Mobile-First
 */

/* ============================================
   BUNDLE-FIRST HERO SECTION
   ============================================ */

.knitting-hero-section {
    background: linear-gradient(135deg, #f5e6d3 0%, #fdf4e7 100%);
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: 48px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 20px;
    color: #555;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.bundle-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto 30px;
}

.bundle-hero-card {
    background: white;
    border-radius: 15px;
    padding: 30px 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.bundle-hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.popular-bundle {
    border: 3px solid #4CAF50;
    transform: scale(1.05);
}

.bundle-label {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.bundle-label.free { background: #e0e0e0; color: #555; }
.bundle-label.popular { background: #4CAF50; color: white; }
.bundle-label.best-value { background: #ff6b6b; color: white; }

.bundle-hero-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.bundle-price {
    font-size: 32px;
    font-weight: 700;
    color: #4CAF50;
    margin: 10px 0;
}

.original-price {
    font-size: 18px;
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
}

.bundle-cta-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.free-btn {
    background: #e0e0e0;
    color: #333;
}

.free-btn:hover {
    background: #d0d0d0;
}

.popular-btn {
    background: #4CAF50;
    color: white;
}

.popular-btn:hover {
    background: #45a049;
    transform: scale(1.02);
}

.master-btn {
    background: #ff6b6b;
    color: white;
}

.master-btn:hover {
    background: #ff5252;
    transform: scale(1.02);
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    font-size: 14px;
    color: #555;
}

/* ============================================
   SKILL LEVEL SELECTOR
   ============================================ */

.skill-selector-section {
    padding: 50px 20px;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

.skill-level-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.skill-btn:hover {
    border-color: #4CAF50;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(76,175,80,0.2);
}

.skill-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #4CAF50;
}

.skill-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.skill-btn h4 {
    font-size: 20px;
    margin-bottom: 8px;
}

.skill-btn p {
    font-size: 14px;
    opacity: 0.8;
}

.skill-recommendation {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.skill-rec-card {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.skill-rec-card h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.rec-cta-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.rec-cta-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

/* ============================================
   PATTERN GENERATOR - BEGINNER-FRIENDLY
   ============================================ */

.pattern-generator-section {
    background: #f8f9fa;
    padding: 50px 20px;
}

.control-hint {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.bundle-upsell {
    margin-top: 30px;
}

.upsell-box {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border-left: 4px solid #ff6b6b;
    padding: 20px;
    border-radius: 8px;
}

.upsell-box h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.upsell-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.upsell-btn:hover {
    background: #ff5252;
    transform: translateX(5px);
}

.export-btn.bundle-export {
    background: #4CAF50;
    color: white;
}

.export-btn.bundle-export:hover {
    background: #45a049;
}

/* ============================================
   PATTERN RESULTS - CONFIDENCE NOTES
   ============================================ */

.beginner-confidence-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196F3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.beginner-confidence-note h4 {
    color: #1565C0;
    margin-bottom: 10px;
    font-size: 18px;
}

.beginner-confidence-note p {
    color: #333;
    line-height: 1.6;
}

.pattern-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pattern-info p {
    margin: 8px 0;
    font-size: 15px;
}

.pattern-upgrade-cta {
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.pattern-upgrade-cta h4 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.pattern-upgrade-cta ul {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
}

.pattern-upgrade-cta li {
    padding: 8px 0;
    font-size: 15px;
}

.upgrade-cta-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.upgrade-cta-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.save-more {
    margin-top: 15px;
    color: #666;
}

.inline-link {
    background: none;
    border: none;
    color: #ff6b6b;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

/* ============================================
   BUNDLES SHOWCASE SECTION
   ============================================ */

.bundles-showcase-section {
    padding: 60px 20px;
    background: white;
}

.bundles-intro {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 50px;
}

.bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.bundle-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bundle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.bundle-card.popular {
    border-color: #4CAF50;
    border-width: 3px;
    position: relative;
}

.bundle-card.best-value {
    border-color: #ff6b6b;
    border-width: 3px;
}

.bundle-header {
    padding: 25px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.bundle-tag {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.bundle-tag.free-tag { background: #e0e0e0; color: #555; }
.bundle-tag.beginner-tag { background: #2196F3; color: white; }
.bundle-tag.popular-tag { background: #4CAF50; color: white; }
.bundle-tag.master-tag { background: #ff6b6b; color: white; }

.bundle-card h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.bundle-body {
    padding: 25px;
    flex-grow: 1;
}

.bundle-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
}

.bundle-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bundle-features li {
    padding: 8px 0;
    font-size: 14px;
    color: #333;
}

.savings-badge {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.testimonial-mini {
    font-style: italic;
    color: #666;
    font-size: 13px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.value-note {
    font-weight: 600;
    color: #ff6b6b;
    margin-top: 15px;
}

.bundle-btn {
    width: calc(100% - 50px);
    margin: 0 25px 25px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bundle-btn.free-btn {
    background: #e0e0e0;
    color: #333;
}

.bundle-btn.beginner-btn {
    background: #2196F3;
    color: white;
}

.bundle-btn.popular-btn {
    background: #4CAF50;
    color: white;
}

.bundle-btn.master-btn {
    background: #ff6b6b;
    color: white;
}

.bundle-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.bundle-guarantee {
    text-align: center;
    font-size: 15px;
    color: #666;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   EMAIL SIGNUP - FREE GUIDE
   ============================================ */

.pattern-email-signup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.pattern-email-signup h3 {
    font-size: 36px;
    margin-bottom: 15px;
}

.email-intro {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.95;
}

.free-guide-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto 40px;
}

.guide-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-align: left;
}

.guide-icon {
    font-size: 32px;
}

.guide-item h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.guide-item p {
    font-size: 13px;
    opacity: 0.9;
}

.pattern-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pattern-form input,
.pattern-form select {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}

.skill-level-quick {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    text-align: left;
}

.skill-level-quick label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.skill-level-quick select {
    width: 100%;
}

.email-signup-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.email-signup-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.email-privacy-note {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 15px;
}

/* ============================================
   AI CHATBOT WIDGET
   ============================================ */

.knitting-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 380px;
    max-height: 600px;
    transition: all 0.3s ease;
}

.knitting-chatbot-widget.minimized {
    width: auto;
    height: auto;
}

.knitting-chatbot-widget.minimized .chatbot-container {
    display: none;
}

.chatbot-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102,126,234,0.6);
}

.chatbot-icon {
    font-size: 24px;
}

.chatbot-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    font-size: 32px;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.chatbot-minimize-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-minimize-btn:hover {
    background: rgba(255,255,255,0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 15px;
    animation: messageSlideIn 0.3s ease;
}

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

.chatbot-message p {
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    max-width: 80%;
    line-height: 1.4;
}

.bot-message p {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.user-message {
    text-align: right;
}

.user-message p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-option-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: left;
}

.chatbot-option-btn:hover {
    background: #5568d3;
    transform: translateX(5px);
}

.chatbot-quick-actions {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: #e0e0e0;
}

.chatbot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
}

.chatbot-input-area button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chatbot-input-area button:hover {
    background: #5568d3;
}

/* ============================================
   BUNDLE MODALS
   ============================================ */

.bundle-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.bundle-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 36px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.bundle-modal-header h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.modal-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
}

.modal-price {
    font-size: 42px;
    font-weight: 700;
    color: #4CAF50;
    margin: 15px 0;
}

.modal-original {
    font-size: 24px;
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
}

.modal-description {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.bundle-modal-features {
    margin: 30px 0;
}

.bundle-modal-features h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.bundle-modal-features ul {
    list-style: none;
    padding: 0;
}

.bundle-modal-features li {
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-testimonial {
    font-style: italic;
    color: #666;
    background: #f8f9fa;
    padding: 15px;
    border-left: 3px solid #4CAF50;
    margin: 20px 0;
}

.modal-cta-btn {
    display: block;
    width: 100%;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    padding: 18px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
}

.modal-cta-btn:hover {
    background: #45a049;
    transform: scale(1.02);
}

.modal-guarantee {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 20px;
}

.free-guide-modal-body h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.free-guide-includes {
    display: grid;
    gap: 15px;
    margin: 30px 0;
}

.guide-benefit {
    display: flex;
    gap: 15px;
    text-align: left;
}

.benefit-icon {
    font-size: 32px;
}

.guide-benefit h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.guide-benefit p {
    font-size: 13px;
    color: #666;
}

.modal-email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-email-form input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.modal-submit-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-submit-btn:hover {
    background: #ff5252;
    transform: scale(1.02);
}

.modal-privacy {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 15px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .bundle-hero-grid {
        grid-template-columns: 1fr;
    }
    
    .popular-bundle {
        transform: scale(1);
    }
    
    .skill-level-selector {
        grid-template-columns: 1fr;
    }
    
    .trust-badges {
        flex-direction: column;
        gap: 10px;
    }
    
    .knitting-chatbot-widget {
        width: calc(100% - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-container {
        height: 500px;
    }
    
    .bundle-modal-content {
        padding: 30px 20px;
    }
    
    .free-guide-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chatbot-toggle {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .chatbot-icon {
        font-size: 20px;
    }
    
    .pattern-email-signup h3 {
        font-size: 28px;
    }
}

/* ============================================
   ENHANCED PATTERN GENERATOR STATES
   ============================================ */

/* Drag-and-Drop Upload Zone */
#upload-zone {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 60px 30px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 30px 0;
}

#upload-zone:hover, 
#uploadArea.drag-over {
    border-color: #4CAF50;
    background: #f0f8f0;
    transform: scale(1.02);
}

#uploadArea.drag-over {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

/* Processing State */
.processing-state {
    padding: 40px 20px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.processing-state p {
    font-size: 18px;
    color: #555;
    margin: 0;
}

/* Success State */
.success-state {
    padding: 40px 20px;
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-state p {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.upload-another-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.upload-another-btn:hover {
    background: #45a049;
}

/* Error State */
.error-state {
    padding: 40px 20px;
    text-align: center;
}

.error-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ff6b6b;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.error-message {
    font-size: 16px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.retry-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #ff5252;
}

/* Pattern Preview Grid */
.pattern-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.pattern-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pattern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.pattern-card h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.pattern-card canvas {
    width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
}

.pattern-legend {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    font-family: monospace;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
}

.download-btn {
    width: 100%;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.download-btn:active {
    transform: scale(0.98);
}

/* Color Palette Display */
.color-palette {
    margin: 40px 0;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.color-palette h4 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.color-swatches {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.color-swatch:hover {
    transform: scale(1.2);
}

/* Hidden file input */
#imageUpload {
    display: none;
}

/* Mobile Responsive for Enhanced Generator */
@media (max-width: 768px) {
    .pattern-preview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #upload-zone {
        padding: 40px 20px;
    }
    
    .color-swatches {
        gap: 10px;
    }
    
    .color-swatch {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .pattern-card {
        padding: 15px;
    }
    
    .pattern-card h3 {
        font-size: 18px;
    }
    
    .download-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}
