/* EB ART Website Color Scheme */
:root {
    --primary-color: #dc2626; /* Red accent from site */
    --primary-hover: #b91c1c;
    --secondary-color: #ffffff;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --background-dark: #000000; /* Black background like site */
    --background-card: #1a1a1a; /* Dark card background */
    --background-light: #2a2a2a; /* Lighter dark for inputs */
    --text-primary: #ffffff; /* White text */
    --text-secondary: #d1d5db; /* Light gray text */
    --border-color: #374151; /* Dark border */
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
}

/* Reset and base styles */
.simulator-app * {
    box-sizing: border-box;
}

.simulator-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background-dark);
    min-height: 100vh;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 0;
    color: var(--text-primary);
}

/* App Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-primary);
}

.app-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.3));
}

.app-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.8;
    margin: 0;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Main Layout */
.simulator-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Controls Panel */
.controls-panel {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.control-section {
    margin-bottom: 2rem;
}

.control-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.section-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

/* File Upload Styles */
.file-upload-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-light);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-secondary);
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-color);
}

.upload-icon {
    font-size: 1.5rem;
}

/* Input Styles */
.dimension-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

input[type="number"],
.frame-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    transition: var(--transition);
    background: var(--background-white);
    color:#f0fdf4!important;
}

input[type="number"]:focus,
.artwork-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Artwork Preview */
.artwork-preview-container {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.artwork-thumbnail {
    max-width: 80px;
    max-height: 80px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
}

.artwork-dimensions {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Preview Panel */
.preview-panel {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

/* Preview Container */
.preview-container {
    position: relative;
    margin-bottom: 2rem;
}

.preview-canvas {
    position: relative;
    width: 100%;
    height: 400px;
    background: 
        linear-gradient(45deg, var(--background-light) 25%, transparent 25%), 
        linear-gradient(-45deg, var(--background-light) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, var(--background-light) 75%), 
        linear-gradient(-45deg, transparent 75%, var(--background-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: var(--background-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wall-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    border-radius: var(--border-radius);
}

.artwork-wrapper {
    position: absolute;
    z-index: 2;
    cursor: grab;
    transition: transform 0.1s ease-out;
    border-radius: 4px;
    line-height: 0;
    font-size: 0;
    overflow: hidden;
    /* Realistic hanging artwork shadow effects */
    box-shadow: 
        /* Main shadow cast by the artwork */
        0 8px 25px rgba(0, 0, 0, 0.15),
        /* Subtle inner shadow for depth */
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        /* Additional depth shadow */
        0 4px 12px rgba(0, 0, 0, 0.1),
        /* Edge highlight for 3D effect */
        0 0 0 1px rgba(0, 0, 0, 0.05);
    /* Slight transform to simulate hanging angle */
    transform-style: preserve-3d;
}

.artwork-wrapper:active {
    cursor: grabbing;
    /* Enhance shadow when dragging to show it's lifted */
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 6px 18px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateZ(10px);
}

.artwork-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
    vertical-align: top;
    line-height: 0;
    object-fit: cover;
    object-position: center;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
    z-index: 0;
}

.placeholder-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: var(--font-size-lg);
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--border-radius);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-overlay p {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-secondary);
    color: var(--background-dark);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--background-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.action-buttons .btn {
    flex: 1;
}

/* Share Options */
.share-options {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.share-options .btn {
    flex: 1;
    font-size: var(--font-size-sm);
    padding: 0.5rem 1rem;
}

/* Remove Frame Styles - not needed anymore */

/* Error and Success Messages */
.error-container {
    margin-top: 1rem;
}

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    font-weight: 500;
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    font-weight: 500;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .controls-panel {
        position: static;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .app-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .simulator-app {
        padding: 1rem;
    }
    
    .controls-panel,
    .preview-panel {
        padding: 1.5rem;
    }
    
    .app-title {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dimension-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .share-options {
        flex-direction: column;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .preview-canvas {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .simulator-app {
        padding: 0.5rem;
    }
    
    .controls-panel,
    .preview-panel {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .file-upload-label {
        padding: 1rem;
        flex-direction: column;
    }
    
    .preview-canvas {
        height: 250px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
    }
}