/* ====================================
   ProductAI - Components CSS
   Buttons, UI elements, and interactive components
   ==================================== */

/* Primary Navigation Button - Modern Gradient Design */
.main-nav-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4), 
                0 4px 15px rgba(118, 75, 162, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.main-nav-btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 25%, #764ba2 50%, #f093fb 100%);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5), 
                0 8px 25px rgba(118, 75, 162, 0.4),
                0 0 25px rgba(240, 147, 251, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.main-nav-btn:disabled {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%) !important;
    color: rgba(0, 0, 0, 0.5) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    opacity: 0.8;
    text-shadow: none !important;
}

/* Secondary Navigation Button - Maximum Readability Design */
.btn-secondary {
    padding: 16px;
    border: 3px solid white;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    backdrop-filter: blur(10px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* Google Login Button */
.google-login-btn {
    background: white;
    color: #333;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px;
}

.google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Sticky Login Components */
.sticky-login-bar.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
    pointer-events: none;
}

.sticky-login-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 428px;
    margin: 0 auto;
    gap: 16px;
}

.sticky-login-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticky-login-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFD700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sticky-login-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.sticky-login-btn {
    background: white;
    color: #333;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sticky-login-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.sticky-login-btn:active {
    transform: translateY(0) scale(1.02);
}

.sticky-google-icon {
    width: 16px;
    height: 16px;
}

.sticky-login-text {
    font-weight: 600;
}

/* Feature Cards */
.feature-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.feature-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Sample Cards */
.sample-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sample-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.sample-image {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 1;
    object-fit: cover;
}

.sample-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.sample-description {
    text-align: center;
    margin-top: 12px;
    font-weight: 600;
    color: #333;
}

/* Pricing Components */
.pricing-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.pricing-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.pricing-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.pricing-option {
    background: white;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid transparent;
}

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

.price-tokens {
    font-size: 0.9rem;
    font-weight: 600;
}

.price-amount {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Icon Buttons - Universal Rounded-Square Style */
.icon-button {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 12px !important; 
    width: 40px !important; 
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    box-sizing: border-box !important;
}

.icon-button .material-icons { 
    font-size: 20px; 
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Step Indicator */
.step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    margin: 0 4px;
    transition: all 0.3s;
}

.step.active {
    background: #667eea;
    transform: scale(1.2);
}

/* Upload Area */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9ff 0%, #e7eaff 100%);
    animation: pulseUpload 2s ease-in-out infinite;
}

.upload-area:hover {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
    animation: none;
}

.upload-area.has-image {
    border-color: #4CAF50;
    background: #f0f8f0;
    animation: none;
}

/* Image Components */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin: 10px 0;
}

.aspect-2-3 {
    aspect-ratio: 2 / 3 !important;
    width: 100% !important;
    height: auto !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* Object Detection */
.object-detection-overlay {
    position: relative;
    display: inline-block;
    z-index: 1; /* keep content under sticky header (header z-index: 100) */
}

.bounding-box {
    position: absolute;
    border: 2px solid #ff4444;
    background: rgba(255, 68, 68, 0.1);
    pointer-events: none;
}

.bounding-box-label {
    position: absolute;
    top: -25px;
    left: 0;
    background: #ff4444;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Preset Cards */
.preset-card {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    height: 200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.preset-card.recommended {
    border: 3px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #f0fff0 100%);
    color: #333;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.preset-card.recommended::before {
    content: "⭐ Recommended";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

.preset-card.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.preset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Preset Badges */
.premium-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
    z-index: 5;
}

.pro-only-badge {
    position: absolute;
    top: -8px;
    left: 8px;
    background: linear-gradient(135deg, #AB47BC 0%, #8E24AA 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
    z-index: 5;
}

/* Preset Images */
.preset-preview-image, .preset-style-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.preset-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.preset-style-preview {
    margin-bottom: 12px;
}

.preset-placeholder-image, .preset-placeholder-style {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e9ecef 100%);
    border: 2px dashed #ced4da;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preset Info */
.preset-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.preset-title-with-tokens {
    margin-bottom: 8px;
}

.preset-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
    color: inherit;
}

.preset-tokens {
    font-size: 11px;
    font-weight: 600;
    color: #4CAF50;
    opacity: 0.9;
}

.preset-card.selected .preset-tokens {
    color: rgba(255, 255, 255, 0.9);
}

.preset-card.recommended .preset-tokens {
    color: rgba(255, 255, 255, 0.9);
}

.preset-description {
    font-size: 11px;
    line-height: 1.3;
    opacity: 0.8;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

.placeholder-text {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    font-weight: 800;
    font-size: 17px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4), 
                0 4px 15px rgba(118, 75, 162, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 25%, #764ba2 50%, #f093fb 100%);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5), 
                0 8px 25px rgba(118, 75, 162, 0.4),
                0 0 25px rgba(240, 147, 251, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
}

/* Generated Images */
.generated-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.generated-image.aspect-2-3 {
    aspect-ratio: 2 / 3 !important;
    width: 100% !important;
    max-width: 400px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

/* Result image focus highlight (subtle moving border) */
.generated-image.focus-highlight {
    position: relative;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.35), 0 8px 24px rgba(0,0,0,0.15);
}
.generated-image.focus-highlight::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    background: conic-gradient(from 0deg, rgba(102,126,234,0.8), rgba(118,75,162,0.8), rgba(240,147,251,0.8), rgba(102,126,234,0.8));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 2px;
    animation: focusBorder 2.2s linear infinite;
    opacity: 0.65;
}
@keyframes focusBorder {
    to { transform: rotate(360deg); }
}

/* Tokens Display */
.tokens-display {
    display: none;
}

.tokens-display-header {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff4444;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease-out;
}

.toast.success {
    background: #4CAF50;
}

.toast.warning {
    background: #ff9800;
}

/* Enhanced Preset Styles */
.preset-preview {
    margin-bottom: 12px;
}

.preset-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    text-align: center;
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

.preset-info h4 {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-info p {
    font-size: 11px !important;
    margin-top: 5px;
    opacity: 0.8;
    line-height: 1.3;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Enhanced Preset States */
.preset-card.selected .preset-preview-image,
.preset-card.selected .preset-style-image {
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.preset-card.recommended .preset-preview-image,
.preset-card.recommended .preset-style-image {
    border-color: #4CAF50;
}

.preset-placeholder-image::before,
.preset-placeholder-style::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%236c757d" viewBox="0 0 24 24"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>') no-repeat center;
    background-size: contain;
    opacity: 0.4;
}

.preset-card.selected .preset-placeholder-image,
.preset-card.selected .preset-placeholder-style {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e7eaff 100%);
}

.preset-card.recommended .preset-placeholder-image,
.preset-card.recommended .preset-placeholder-style {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
} 

/* ===========================================
   Test Modules Interface Styling
   =========================================== */

/* Parameter Display Module */
.parameter-display-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.parameter-display-controls .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.parameter-display-controls .btn-success {
    background: #ffffff;
    color: #667eea;
    border: 3px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.parameter-display-controls .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.parameter-display-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.parameter-display-output {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
}

.parameter-display-output h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.parameter-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.parameter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
}

.param-key {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
    flex-shrink: 0;
}

.param-value {
    color: #6c757d;
    text-align: right;
    word-break: break-word;
    flex-grow: 1;
}

.backend-response {
    margin-top: 16px;
    min-height: 50px;
}

.backend-response .success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 16px;
    border-radius: 6px;
}

.backend-response .error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 16px;
    border-radius: 6px;
}

.backend-response .loading {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 16px;
    border-radius: 6px;
    text-align: center;
}

/* Module Selector Module */
.module-selector-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.module-selector-controls .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.module-selector-controls .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.module-selector-controls .btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #f39c12 100%);
    color: #212529;
}

.module-selector-list {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.module-selector-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.module-selector-item:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.module-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.module-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.module-name {
    color: #495057;
}

.module-status {
    font-size: 16px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.module-status.enabled {
    background: #d4edda;
    color: #155724;
}

.module-status.disabled {
    background: #f8d7da;
    color: #721c24;
}

.module-selector-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    margin-top: 16px;
}

/* Test Modules Error States */
.test-modules-error {
    background: linear-gradient(135deg, #ff5722 0%, #f44336 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.test-modules-error h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.test-modules-error p {
    margin: 8px 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    
    .parameter-display-controls,
    .module-selector-controls {
        flex-direction: column;
    }
    
    .parameter-display-controls .btn,
    .module-selector-controls .btn {
        justify-content: center;
        width: 100%;
    }
    
    .module-selector-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Animation for Test Modules */
@keyframes testModulesSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-modules-container {
    animation: testModulesSlideIn 0.5s ease-out;
}

/* Backend Response Details */
.backend-details {
    margin: 12px 0;
}

.backend-details p {
    margin: 6px 0;
    font-size: 14px;
}

.backend-response details {
    margin-top: 12px;
}

.backend-response summary {
    cursor: pointer;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    font-weight: 500;
}

.backend-response pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    font-size: 12px;
    overflow-x: auto;
    margin: 8px 0 0 0;
}

/* ====================================
   Enhanced Module UI - 2-Column Layout
   ==================================== */

/* 2-Column Grid for Category Options */
.radio-grid-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

/* Mobile responsive - single column on small screens */
@media (max-width: 600px) {
    .radio-grid-two-column {
        grid-template-columns: 1fr;
    }
}

/* Horizontal layout for color options */
.radio-grid-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.radio-grid-horizontal .radio-option {
    flex: 1;
    min-width: 120px;
}

/* Enhanced radio option styling for compact layout */
.radio-grid-two-column .radio-option,
.radio-grid-horizontal .radio-option {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.radio-grid-two-column .radio-option:hover,
.radio-grid-horizontal .radio-option:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.radio-grid-two-column .radio-option.selected,
.radio-grid-horizontal .radio-option.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.radio-grid-two-column .radio-option-content,
.radio-grid-horizontal .radio-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-grid-two-column .radio-option-title,
.radio-grid-horizontal .radio-option-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 4px;
}

.radio-grid-two-column .radio-option-description,
.radio-grid-horizontal .radio-option-description {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
}

/* Color picker integration */
.color-picker-input {
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

.color-picker-input:hover {
    border-color: #007bff !important;
}

/* Compact color options styling */
.color-option-compact {
    padding: 6px 10px !important;
    min-height: auto !important;
}

.color-option-compact .radio-option-content {
    gap: 0 !important;
}

.color-option-compact .radio-option-title {
    font-size: 11px !important;
    line-height: 1.3 !important;
}

/* Token counter micro-animations */
.token-counter-pulse {
    animation: tokenPulse 0.25s ease-out;
}

@keyframes tokenPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
    50% { transform: scale(1.02); filter: drop-shadow(0 1px 3px rgba(0,0,0,0.1)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
}

.token-delta-chip {
    position: absolute;
    pointer-events: none;
    z-index: 1000; /* Reduced from 9999 to prevent overlay issues */
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px; /* Smaller padding */
    font-size: 10px; /* Smaller font */
    font-weight: 600; /* Less bold */
    opacity: 0;
    transform: translateY(0) scale(0.8); /* Smaller initial scale */
    transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease; /* Faster animation */
    filter: drop-shadow(0 1px 4px rgba(102,126,234,0.25)); /* Lighter shadow */
}

.token-delta-chip.show {
    opacity: 1;
    transform: translateY(-12px) scale(0.9); /* Smaller and less movement */
}

.token-delta-chip.fade {
    opacity: 0;
    transform: translateY(-30px) scale(0.98);
}

/* Lightweight confetti for celebration */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    z-index: 9999;
    opacity: 0.95;
    animation: confettiFall 1.2s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--dr)); opacity: 0; }
}