/* FXB3 Embed CSS - Complete styling with doogmafxb- namespacing */

/* Improved Theme Color Contrast Algorithm */
:root {
  /* Get the original theme color from CSS custom property or default */
  --original-theme-color: #23C1F1;
  
  /* Calculate contrast and adjust if needed */
  --theme-color: var(--adjusted-theme-color, var(--original-theme-color));
  --theme-color-dark: var(--adjusted-theme-color-dark, #1a9bc7);
  --theme-color-light: var(--adjusted-theme-color-light, #4dd1ff);
  
  /* Backward compatibility with existing variable names */
  --color-primary: var(--theme-color);
  --color-primary-dark: var(--theme-color-dark);
  --color-primary-light: var(--theme-color-light);
  --color-primary-lightest: hsl(195, 85%, 95%);
  --color-primary-hover: var(--theme-color-light);
  --color-primary-active: var(--theme-color-dark);
  --color-primary-disabled: hsl(195, 85%, 60%);
  --color-primary-darker: hsl(195, 85%, 20%);
}

/* JavaScript will set these custom properties */

/* Modal Structure */
.doogmafxb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.doogmafxb-modal-content {
    width: 90vw;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: doogmafxb-modal-enter 0.3s ease-out;
    max-height: 90vh; /* Ensure modal doesn't exceed viewport height */
}

@keyframes doogmafxb-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.doogmafxb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--color-primary-darker) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.doogmafxb-modal-title {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doogmafxb-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doogmafxb-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.doogmafxb-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Loading State */
.doogmafxb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 18px;
    color: #64748b;
    gap: 10px;
}

.doogmafxb-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: doogmafxb-spin 1s linear infinite;
}

@keyframes doogmafxb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Wizard Layout */
.doogmafxb-wizard-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Wizard Content */
.doogmafxb-wizard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doogmafxb-wizard-sidebar {
    width: 300px;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.doogmafxb-wizard-main {
    flex: 1;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Progress Steps */
.doogmafxb-progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    gap: 20px;
}

.doogmafxb-steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

.doogmafxb-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.doogmafxb-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.doogmafxb-step-label {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Step States */
.doogmafxb-step-item.doogmafxb-current .doogmafxb-step-circle {
    background: var(--color-primary);
    color: white;
}

.doogmafxb-step-item.doogmafxb-current .doogmafxb-step-label {
    color: var(--color-primary);
    font-weight: 600;
}

.doogmafxb-step-item.doogmafxb-completed .doogmafxb-step-circle {
    background: var(--color-primary);
    color: white;
}

.doogmafxb-step-item.doogmafxb-completed .doogmafxb-step-label {
    color: var(--color-primary);
    font-weight: 600;
}

/* Disabled Step States */
.doogmafxb-step-item.doogmafxb-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: auto; /* Allow clicks for feedback */
}

.doogmafxb-step-item.doogmafxb-disabled:hover {
    opacity: 0.5;
    transform: none;
}

.doogmafxb-step-item.doogmafxb-disabled .doogmafxb-step-circle {
    background: #9ca3af;
    color: #6b7280;
}

.doogmafxb-step-item.doogmafxb-disabled .doogmafxb-step-label {
    color: #6b7280;
    font-weight: 500;
}

/* Step Navigation Feedback */
.doogmafxb-step-navigation-feedback {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: doogmafxb-feedback-enter 0.3s ease-out;
    max-width: 300px;
    text-align: center;
}

/* Mobile responsive feedback */
@media (max-width: 768px) {
    .doogmafxb-step-navigation-feedback {
        position: fixed;
        top: auto;
        bottom: 80px;
        left: 20px;
        right: 20px;
        transform: none;
        max-width: none;
        margin-top: 0;
        z-index: 10001;
    }
}

.doogmafxb-feedback-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doogmafxb-feedback-icon {
    font-size: 16px;
    color: #f59e0b;
}

.doogmafxb-feedback-message {
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
    line-height: 1.4;
}

@keyframes doogmafxb-feedback-enter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Navigation Buttons in Progress Bar */
.doogmafxb-progress-steps .doogmafxb-nav-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
}

.doogmafxb-progress-steps .doogmafxb-nav-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.doogmafxb-progress-steps .doogmafxb-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.doogmafxb-progress-steps .doogmafxb-btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.doogmafxb-progress-steps .doogmafxb-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.doogmafxb-progress-steps .doogmafxb-btn-success {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.doogmafxb-progress-steps .doogmafxb-btn-success:hover:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* Sub Navigation */
.doogmafxb-sub-nav {
    background: #f1f5f9;
    padding: 20px 40px;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.doogmafxb-sub-nav-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doogmafxb-sub-nav-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.doogmafxb-sub-nav-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.doogmafxb-sub-nav-btn.doogmafxb-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.doogmafxb-sub-nav-icon {
    font-size: 16px;
}

/* Cards Grid */
.doogmafxb-cards-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px;
    max-height: 100%;
    position: relative;
    scroll-behavior: smooth;
    transition: scroll-top 0.3s ease-out;
}

/* Template Container */
.doogmafxb-template-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px;
    max-height: 100%;
    position: relative;
    scroll-behavior: smooth;
    transition: scroll-top 0.3s ease-out;
}

/* Template content styling */
.doogmafxb-template-container .doogmafxb-form-section {
    margin-bottom: 30px;
}

.doogmafxb-template-container .doogmafxb-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.doogmafxb-template-container .doogmafxb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.doogmafxb-template-container .doogmafxb-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doogmafxb-template-container .doogmafxb-form-label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.doogmafxb-template-container .doogmafxb-form-control {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.doogmafxb-template-container .doogmafxb-form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.1);
}

.doogmafxb-template-container .doogmafxb-color-pickers {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.doogmafxb-template-container .doogmafxb-color-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Image Upload Styles */
.doogmafxb-image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.doogmafxb-image-upload-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doogmafxb-image-upload-area {
    position: relative;
    width: 100%;
    max-width: 200px;
}

.doogmafxb-upload-placeholder {
    width: 140px;
    height: 140px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.doogmafxb-upload-placeholder:hover {
    border-color: var(--color-primary);
    background: #f1f5f9;
}

.doogmafxb-upload-placeholder.doogmafxb-loading {
    border-color: var(--color-primary);
    background: #f1f5f9;
}

.doogmafxb-upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
    color: #64748b;
}

.doogmafxb-upload-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.doogmafxb-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: doogmafxb-spin 1s linear infinite;
    margin-bottom: 8px;
}

.doogmafxb-uploaded-image {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.doogmafxb-uploaded-image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8fafc;
}

.doogmafxb-remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.doogmafxb-remove-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.doogmafxb-image-actions {
    margin-top: 8px;
    text-align: center;
}

.doogmafxb-replace-image-btn {
    color: var(--color-primary);
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0;
    margin: 0;
}

.doogmafxb-replace-image-btn:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.doogmafxb-hidden-file-input {
    display: none;
}

.doogmafxb-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.doogmafxb-option-card {
    aspect-ratio: 3/4;
    background: #f8fafc;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.doogmafxb-option-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 255, 0.2);
}

.doogmafxb-option-card.doogmafxb-selected {
    border-color: var(--color-primary);
    background: #f8fafc; /* Same as unselected cards */
    box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.2);
}

.doogmafxb-option-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.doogmafxb-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(241, 245, 249, 0.7);
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    padding: 8px 12px;
    border-radius: 0 0 12px 12px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.doogmafxb-option-card.doogmafxb-selected .doogmafxb-card-label {
    background: var(--color-primary);
    color: white;
    font-weight: 700;
}

/* Navigation Buttons */
.doogmafxb-nav-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doogmafxb-btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.doogmafxb-btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.doogmafxb-btn-secondary {
    background: white;
    color: #64748b;
    border-color: #e5e7eb;
}

.doogmafxb-btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.doogmafxb-btn-success {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.doogmafxb-btn-success:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.doogmafxb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Styles */
.doogmafxb-form-section {
    margin-bottom: 30px;
}

.doogmafxb-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.doogmafxb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.doogmafxb-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doogmafxb-form-label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.doogmafxb-form-control {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.doogmafxb-form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.1);
}

.doogmafxb-form-control:invalid {
    border-color: #ef4444;
}

/* Color Picker Styles */
.doogmafxb-color-pickers {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.doogmafxb-color-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Shuffle Button Styles */
.doogmafxb-shuffle-section {
    margin-top: 20px;
    text-align: center;
}

.doogmafxb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.doogmafxb-section-header .doogmafxb-section-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.doogmafxb-shuffle-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    background: white;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doogmafxb-shuffle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.doogmafxb-shuffle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.doogmafxb-color-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.doogmafxb-color-swatch {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    padding: 4px;
    background-color: var(--swatch-color);
}

.doogmafxb-color-swatch:hover {
    transform: scale(1.05);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 255, 0.2);
}

.doogmafxb-color-swatch.doogmafxb-selected {
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.2);
}

.doogmafxb-color-swatch.doogmafxb-selected::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Summary Styles */
.doogmafxb-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.doogmafxb-summary-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.doogmafxb-summary-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.doogmafxb-summary-value {
    color: #64748b;
    font-size: 14px;
}

.doogmafxb-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Utility Classes */
.doogmafxb-hidden {
    display: none !important;
}

.doogmafxb-text-center {
    text-align: center;
}

.doogmafxb-text-muted {
    color: #64748b;
}

.doogmafxb-mt-20 {
    margin-top: 20px;
}

.doogmafxb-mb-20 {
    margin-bottom: 20px;
}

/* Main Content Layout */
.doogmafxb-main-content {
    display: flex;
    flex: 1;
    height: 100%; /* Use full height of modal body */
    max-height: calc(90vh - 120px); /* Account for header and progress steps */
    overflow: hidden; /* Prevent content from extending beyond modal */
}

.doogmafxb-canvas-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    padding: 0; /* Remove padding */
    height: 100%; /* Ensure it takes full height of parent */
    max-height: 100%; /* Prevent exceeding parent height */
    overflow: hidden; /* Prevent content from extending beyond section */
}

/* Offscreen Canvas */
#doogmafxb-offscreen-canvas {
    position: absolute;
    left: -9999px;
    width: 300px;
    height: 400px;
    z-index: -1;
}

/* Canvas Wrapper Updates */
.doogmafxb-canvas-wrapper {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Full screen canvas wrapper for mobile */
.doogmafxb-canvas-section.doogmafxb-mobile-visible .doogmafxb-canvas-wrapper {
    border-radius: 0;
    background: #f8fafc;
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doogmafxb-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Full screen canvas styling */
.doogmafxb-canvas-section.doogmafxb-mobile-visible .doogmafxb-canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Card Image Container */
.doogmafxb-card-image {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.doogmafxb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.doogmafxb-loading-indicator {
    color: #6c757d;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* Loading Animation */
@keyframes doogmafxb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.doogmafxb-loading-indicator {
    animation: doogmafxb-pulse 1.5s ease-in-out infinite;
}

.doogmafxb-wizard-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow flex item to shrink */
}

/* Team Information Styles */
.doogmafxb-team-info-section {
    margin-bottom: 30px;
}

.doogmafxb-team-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.doogmafxb-team-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doogmafxb-team-info-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.doogmafxb-team-info-value {
    color: #6b7280;
    font-size: 16px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Saving Feedback Styles */
.doogmafxb-saving-feedback {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    transition: all 0.3s ease;
}

.doogmafxb-saving-feedback.doogmafxb-hidden {
    display: none;
}

.doogmafxb-saving-message {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    padding: 10px 20px;
    background: rgba(0, 0, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 255, 0.1);
    animation: doogmafxb-pulse 1.5s ease-in-out infinite;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .doogmafxb-modal-content {
        width: 95vw;
        height: 95vh;
    }
    
    .doogmafxb-main-content {
        height: calc(95vh - 200px);
    }
    
    .doogmafxb-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .doogmafxb-template-container {
        padding: 15px 20px;
    }
    
    .doogmafxb-template-container .doogmafxb-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .doogmafxb-image-upload-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .doogmafxb-upload-placeholder,
    .doogmafxb-uploaded-image {
        width: 126px;
        height: 126px;
    }
    
    .doogmafxb-progress-steps {
        padding: 15px 20px;
        gap: 15px;
    }
    
    .doogmafxb-sub-nav {
        padding: 15px 20px;
    }
    
    .doogmafxb-cards-container {
        padding: 15px 20px;
    }
    
    .doogmafxb-color-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
    
    .doogmafxb-color-swatch {
        width: 50px;
        height: 35px;
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .doogmafxb-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    /* Compact Header - Remove title, keep only close button */
    .doogmafxb-modal-header {
        padding: 10px 15px;
        min-height: 50px;
        justify-content: flex-end; /* Only close button */
    }
    
    .doogmafxb-modal-title {
        display: none; /* Hide title on mobile */
    }
    
    .doogmafxb-close-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .doogmafxb-main-content {
        flex-direction: column;
        height: calc(100vh - 50px); /* Account for compact header */
        overflow: visible;
    }
    
    .doogmafxb-canvas-section {
        position: absolute;
        left: -9999px;
        top: -9999px;
        width: 1px;
        height: 1px;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 15px;
    }
    
    .doogmafxb-canvas-section.doogmafxb-mobile-visible {
        display: flex; /* Show when toggled */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 10003;
        background: #f8fafc;
        border: none;
        padding: 0;
        flex-direction: column;
    }
    
    /* Compact Progress Steps - Tab Style */
    .doogmafxb-progress-steps {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
        padding: 8px 15px;
        gap: 0;
        flex-direction: column;
        min-height: auto;
    }
    
    /* Hide Previous/Next buttons */
    .doogmafxb-progress-steps .doogmafxb-nav-btn {
        display: none;
    }
    
    /* Steps Container - Horizontal Tab Style */
    .doogmafxb-steps-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        padding: 3px 0;
    }
    
    .doogmafxb-steps-container::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
    }
    
    .doogmafxb-step-item {
        flex-shrink: 0;
        min-width: 60px;
        cursor: pointer;
    }
    
    .doogmafxb-step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .doogmafxb-step-label {
        font-size: 10px;
        line-height: 1.2;
    }
    
    /* Sub Navigation - Horizontal Carousel */
    .doogmafxb-sub-nav {
        position: sticky;
        top: 60px; /* Position after progress steps (8px padding + 36px circle + 4px margin + 10px label + 2px padding) */
        z-index: 999;
        background: #f1f5f9;
        padding: 8px 15px;
        border-bottom: 1px solid #e5e7eb;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 0; /* Remove any margin */
    }
    
    .doogmafxb-sub-nav::-webkit-scrollbar {
        display: none;
    }
    
    .doogmafxb-sub-nav-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        min-width: max-content;
    }
    
    .doogmafxb-sub-nav-btn {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
        min-width: auto;
    }
    
    .doogmafxb-wizard-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        padding: 0; /* Remove any default padding */
        margin: 0; /* Remove any default margin */
    }
    
    .doogmafxb-wizard-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0; /* Remove any default padding */
        margin: 0; /* Remove any default margin */
    }
    
    .doogmafxb-wizard-main {
        flex: 1;
        overflow: hidden;
        padding: 0; /* Remove default padding */
        display: flex;
        flex-direction: column;
    }
    
    .doogmafxb-cards-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .doogmafxb-template-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding: 15px 20px;
    }
    
    .doogmafxb-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .doogmafxb-template-container .doogmafxb-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .doogmafxb-image-upload-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .doogmafxb-upload-placeholder,
    .doogmafxb-uploaded-image {
        width: 98px;
        height: 98px;
        margin: 0 auto;
    }
    
    .doogmafxb-color-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .doogmafxb-color-swatch {
        width: 45px;
        height: 32px;
        font-size: 8px;
    }
    
    /* Mobile 3D Toggle Button */
    .doogmafxb-mobile-3d-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: 50px;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 10001;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .doogmafxb-mobile-3d-toggle:hover {
        background: var(--color-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }
    
    .doogmafxb-mobile-3d-toggle.doogmafxb-active {
        background: var(--color-primary-dark);
    }
    
    /* Canvas Close Button */
    .doogmafxb-canvas-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        font-size: 20px;
        cursor: pointer;
        z-index: 10004;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .doogmafxb-canvas-close-btn:hover {
        background: rgba(0, 0, 0, 0.9);
    }
}

@media (max-width: 480px) {
    .doogmafxb-main-content {
        height: calc(100vh - 50px);
        overflow: visible;
    }
    
    .doogmafxb-canvas-section {
        position: absolute;
        left: -9999px;
        top: -9999px;
        width: 1px;
        height: 1px;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        padding: 10px;
    }
    
    .doogmafxb-canvas-section.doogmafxb-mobile-visible {
        display: flex; /* Show when toggled */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 10003;
        background: #f8fafc;
        border: none;
        padding: 0;
        flex-direction: column;
    }
    
    .doogmafxb-wizard-section {
        overflow-y: auto;
        min-height: 0;
        padding: 0;
        margin: 0;
    }
    
    .doogmafxb-wizard-content {
        padding: 0;
        margin: 0;
    }
    
    .doogmafxb-wizard-main {
        padding: 0;
    }
    
    .doogmafxb-cards-container {
        overflow-y: auto;
        min-height: 0;
    }
    
    .doogmafxb-template-container {
        overflow-y: auto;
        min-height: 0;
        padding: 10px 15px;
    }
    
    .doogmafxb-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .doogmafxb-template-container .doogmafxb-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .doogmafxb-image-upload-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .doogmafxb-upload-placeholder,
    .doogmafxb-uploaded-image {
        width: 140px;
        height: 140px;
        margin: 0 auto;
    }
    
    /* Smaller progress steps for very small screens */
    .doogmafxb-step-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .doogmafxb-step-label {
        font-size: 9px;
    }
    
    .doogmafxb-steps-container {
        gap: 12px;
        padding: 2px 0;
    }
    
    .doogmafxb-sub-nav {
        top: 50px; /* Position after progress steps for smaller screens (6px padding + 32px circle + 4px margin + 9px label + 1px padding) */
        padding: 6px 15px;
        margin: 0;
    }
    
    .doogmafxb-sub-nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .doogmafxb-color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .doogmafxb-color-swatch {
        width: 40px;
        height: 28px;
        font-size: 7px;
    }
    
    /* Mobile 3D Toggle Button - Smaller on very small screens */
    .doogmafxb-mobile-3d-toggle {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

