/**
 * Simple Form Styles for Trading Card Designer
 * Adapted to match main application dark theme
 * Mobile-first responsive design
 */

/* ==========================================================================
   Layout and Sections
   ========================================================================== */

.trading-card-product-form {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--stc-space-5, 1.25rem);
    font-family: var(--stc-font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
    background-color: var(--stc-bg-dark, #121212);
}

.stc-simple-form-section {
    margin-bottom: var(--stc-space-8, 2rem);
}

.stc-simple-form-section h3 {
    margin: 0 0 var(--stc-space-3, 0.75rem) 0;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
}

.stc-simple-form-description {
    margin: 0 0 var(--stc-space-5, 1.25rem) 0;
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.95em;
    line-height: 1.5;
}

/* Advanced Design Section - Hidden on mobile by default */
.stc-advanced-design-section {
    display: none;
    text-align: center;
    padding: var(--stc-space-5, 1.25rem) 0;
}

.stc-design-divider {
    position: relative;
    margin: var(--stc-space-8, 2rem) 0;
    text-align: center;
}

.stc-design-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--stc-border-light, rgba(255, 255, 255, 0.1));
}

.stc-design-divider span {
    background: var(--stc-bg-dark, #121212);
    padding: 0 var(--stc-space-4, 1rem);
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stc-advanced-design-description {
    margin: 0 0 var(--stc-space-5, 1.25rem) 0;
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.95em;
}

/* ==========================================================================
   Simple Form Styles
   ========================================================================== */

.stc-simple-form {
    background: var(--stc-bg-card, #252525);
    border: 1px solid var(--stc-border-light, rgba(255, 255, 255, 0.1));
    border-radius: var(--stc-radius-lg, 0.5rem);
    padding: var(--stc-space-5, 1.25rem);
    box-shadow: var(--stc-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2));
}

.stc-simple-field {
    margin-bottom: var(--stc-space-5, 1.25rem);
}

.stc-simple-field:last-of-type {
    margin-bottom: 0;
}

.stc-simple-label {
    display: block;
    margin-bottom: var(--stc-space-2, 0.5rem);
    font-weight: 600;
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
    font-size: 0.95em;
}

.stc-required-indicator {
    color: var(--stc-danger, #F44336);
    margin-left: var(--stc-space-1, 0.25rem);
}

.stc-optional-indicator {
    font-weight: 400;
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.85em;
}

.stc-simple-input {
    width: 100%;
    padding: var(--stc-space-3, 0.75rem) var(--stc-space-4, 1rem);
    border: 1px solid var(--stc-border-medium, rgba(255, 255, 255, 0.15));
    border-radius: var(--stc-radius-md, 0.375rem);
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: var(--stc-transition-fast, 150ms ease);
    box-sizing: border-box;
    background-color: var(--stc-bg-card, #252525);
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stc-simple-input:focus {
    outline: none;
    border-color: var(--stc-primary, #D88126);
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-simple-input::placeholder {
    color: var(--stc-text-muted, #475569);
}

.stc-simple-input:invalid {
    border-color: var(--stc-danger, #F44336);
}

/* ==========================================================================
   Image Upload Styles
   ========================================================================== */

.stc-simple-image-field {
    margin-bottom: var(--stc-space-6, 1.5rem);
}

.stc-image-upload-container {
    position: relative;
}

.stc-image-upload-area {
    position: relative;
    min-height: 150px;
    border: 2px dashed var(--stc-border-medium, rgba(255, 255, 255, 0.15));
    border-radius: var(--stc-radius-lg, 0.5rem);
    cursor: pointer;
    transition: var(--stc-transition-fast, 150ms ease);
    overflow: hidden;
    background-color: var(--stc-bg-lighter, #1E1E1E);
}

.stc-image-upload-area:hover {
    border-color: var(--stc-primary, #D88126);
    background-color: var(--stc-primary-light, rgba(216, 129, 38, 0.15));
}

.stc-image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--stc-space-8, 2rem) var(--stc-space-5, 1.25rem);
    text-align: center;
    height: 150px;
    box-sizing: border-box;
}

.stc-upload-icon {
    width: 48px;
    height: 48px;
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    margin-bottom: var(--stc-space-4, 1rem);
}

.stc-upload-text {
    display: block;
    font-weight: 600;
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
    margin-bottom: var(--stc-space-1, 0.25rem);
    font-size: 0.95em;
}

.stc-upload-hint {
    display: block;
    color: var(--stc-text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.85em;
}

.stc-image-preview {
    position: relative;
    width: 100%;
    height: 150px;
}

.stc-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--stc-radius-md, 0.375rem);
}

.stc-remove-image {
    position: absolute;
    top: var(--stc-space-2, 0.5rem);
    right: var(--stc-space-2, 0.5rem);
    width: 28px;
    height: 28px;
    background: rgba(244, 67, 54, 0.9);
    color: var(--stc-white, #ffffff);
    border: none;
    border-radius: var(--stc-radius-full, 9999px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: var(--stc-transition-fast, 150ms ease);
}

.stc-remove-image:hover {
    background: var(--stc-danger, #F44336);
}

/* ==========================================================================
   Error States
   ========================================================================== */

.stc-field-error {
    margin-top: var(--stc-space-1, 0.25rem);
    padding: var(--stc-space-2, 0.5rem) var(--stc-space-3, 0.75rem);
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--stc-danger, #F44336);
    border-radius: var(--stc-radius-sm, 0.25rem);
    color: var(--stc-danger, #F44336);
    font-size: 0.85em;
    line-height: 1.3;
}

.stc-simple-field.has-error .stc-simple-input {
    border-color: var(--stc-danger, #F44336);
}

.stc-simple-field.has-error .stc-image-upload-area {
    border-color: var(--stc-danger, #F44336);
}

/* ==========================================================================
   Price Display
   ========================================================================== */

.stc-simple-price {
    background: var(--stc-bg-lighter, #1E1E1E);
    border: 1px solid var(--stc-border-light, rgba(255, 255, 255, 0.1));
    border-radius: var(--stc-radius-md, 0.375rem);
    padding: var(--stc-space-4, 1rem) var(--stc-space-5, 1.25rem);
    margin: var(--stc-space-5, 1.25rem) 0;
    box-shadow: var(--stc-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2));
}

.stc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1em;
    color: var(--stc-text-primary, rgba(255, 255, 255, 0.9));
}

.stc-price-value {
    color: var(--stc-primary, #D88126);
    font-size: 1.2em;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.stc-simple-actions {
    margin-top: var(--stc-space-6, 1.5rem);
    text-align: center;
}

.stc-simple-submit {
    width: 100%;
    padding: var(--stc-space-4, 1rem) var(--stc-space-8, 2rem);
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--stc-radius-md, 0.375rem);
    transition: var(--stc-transition-fast, 150ms ease);
    min-height: 50px;
    background-color: var(--stc-primary, #D88126);
    color: var(--stc-white, #ffffff);
    border: none;
    cursor: pointer;
    box-shadow: var(--stc-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2));
}

.stc-simple-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stc-simple-submit:not(:disabled):hover {
    background-color: var(--stc-primary-hover, #F09339);
    transform: translateY(-1px);
    box-shadow: var(--stc-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2));
}

.stc-simple-submit:not(:disabled):active {
    background-color: var(--stc-primary-active, #B66B1F);
    transform: translateY(1px);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.stc-simple-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--stc-radius-lg, 0.5rem);
    z-index: 10;
}

.stc-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--stc-gray-300, rgba(255, 255, 255, 0.2));
    border-top: 3px solid var(--stc-primary, #D88126);
    border-radius: var(--stc-radius-full, 9999px);
    animation: stc-spin 1s linear infinite;
    margin-bottom: var(--stc-space-3, 0.75rem);
}

@keyframes stc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stc-simple-loading span {
    color: var(--stc-primary, #D88126);
    font-weight: 600;
}

/* ==========================================================================
   Drag and Drop States
   ========================================================================== */

.stc-image-upload-area.stc-drag-over {
    border-color: var(--stc-primary, #D88126);
    background-color: var(--stc-primary-light, rgba(216, 129, 38, 0.15));
    transform: scale(1.02);
}

.stc-image-upload-area.stc-drag-over .stc-upload-icon {
    color: var(--stc-primary, #D88126);
    transform: scale(1.1);
}

.stc-image-upload-area.stc-drag-over .stc-upload-text {
    color: var(--stc-primary, #D88126);
}

.stc-mobile-only {
    display: block !important;
}

/* ==========================================================================
   Responsive Design - Desktop
   ========================================================================== */

@media (min-width: 1024px) {
    
    /* Show advanced design section on desktop */
    .stc-desktop-only {
        display: block !important;
    }

    .stc-mobile-only {
        display: none !important;
    }
    
    .trading-card-product-form {
        max-width: 800px;
        padding: var(--stc-space-8, 2rem);
    }
    
    .stc-simple-form {
        padding: var(--stc-space-8, 2rem);
    }
    
    .stc-simple-field {
        margin-bottom: var(--stc-space-6, 1.5rem);
    }
    
    .stc-image-upload-area {
        min-height: 200px;
    }
    
    .stc-image-upload-placeholder {
        height: 200px;
        padding: var(--stc-space-10, 2.5rem) var(--stc-space-8, 2rem);
    }
    
    .stc-image-preview {
        height: 200px;
    }
    
    .stc-upload-icon {
        width: 64px;
        height: 64px;
        margin-bottom: var(--stc-space-5, 1.25rem);
    }
    
    .stc-simple-submit {
        width: auto;
        min-width: 200px;
        padding: var(--stc-space-4, 1rem) var(--stc-space-10, 2.5rem);
    }
    
    /* Two-column layout for team fields on desktop */
    .stc-team-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--stc-space-5, 1.25rem);
    }
}

@media (min-width: 1024px) {
    .trading-card-product-form {
        max-width: 900px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .stc-simple-input,
    .stc-image-upload-area,
    .stc-simple-submit,
    .stc-remove-image {
        transition: none;
    }
    
    .stc-loading-spinner {
        animation: none;
        border: 3px solid var(--stc-primary, #D88126);
    }
}

/* Focus styles for keyboard navigation */
.stc-image-upload-area:focus-within {
    outline: 2px solid var(--stc-primary, #D88126);
    outline-offset: 2px;
}

.stc-remove-image:focus {
    outline: 2px solid var(--stc-white, #ffffff);
    outline-offset: 2px;
}