/* Create Page Styles - Based on edit.css with create-specific modifications */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Kumbh Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.create-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.create-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left .back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.header-left .back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.header-center h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
}

.header-right .logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Main Content */
.create-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: white;
    text-align: center;
}

.loading-spinner {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.loading-state p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Form Styles */
.create-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-of-type {
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4a5568;
    font-size: 1.4rem;
    font-weight: 600;
}

.section-header h2 i {
    color: #667eea;
    font-size: 1.2rem;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #718096;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* File Upload Areas */
.file-upload-area {
    position: relative;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    pointer-events: none;
}

.file-upload-placeholder i {
    font-size: 2rem;
    opacity: 0.7;
}

.file-upload-placeholder span {
    font-weight: 500;
    font-size: 1rem;
}

.file-upload-placeholder small {
    color: #718096;
    font-size: 0.85rem;
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Extract Button */
.extract-button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.extract-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Transform Inputs */
.transform-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.transform-inputs input {
    text-align: center;
    font-size: 0.9rem;
}

.flip-button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.flip-button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Camera Mode Toggle */
.camera-mode-toggle {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.camera-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-family: "Kumbh Sans", sans-serif;
    color: #666;
}

.camera-btn i {
    font-size: 1rem;
}

.camera-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    transform: translateY(-1px);
}

.camera-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Collider Section */
.collider-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.collider-section h3 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.selected-tags {
    min-height: 60px;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.selected-tags-placeholder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #718096;
    font-style: italic;
}

.selected-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.selected-tag .remove-tag {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.selected-tag .remove-tag:hover {
    opacity: 1;
}

.available-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.available-tag {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
}

.available-tag:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.available-tag.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.cancel-button {
    padding: 0.75rem 1.5rem;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 2px solid rgba(108, 117, 125, 0.3);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.cancel-button:hover {
    background: rgba(108, 117, 125, 0.2);
    border-color: rgba(108, 117, 125, 0.5);
    transform: translateY(-2px);
}

.create-button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.create-button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.create-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.create-button.loading {
    background: linear-gradient(135deg, #9E9E9E, #757575);
    cursor: wait;
}

.create-button.loading:hover {
    background: linear-gradient(135deg, #9E9E9E, #757575);
    transform: none;
}

/* Feedback Container */
.feedback-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.feedback-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease;
}

.feedback-message.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.feedback-message.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.feedback-message.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .create-content {
        padding: 1rem;
    }
    
    .create-form {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .header-center h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .transform-inputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .feedback-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .available-tags {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left,
    .header-right {
        order: 2;
    }
    
    .header-center {
        order: 1;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .file-upload-placeholder i {
        font-size: 1.5rem;
    }
}

/* Animation for smooth transitions */
.create-form,
.loading-state {
    animation: fadeIn 0.5s ease;
}

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

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Custom scrollbar for available tags */
.available-tags::-webkit-scrollbar {
    width: 6px;
}

.available-tags::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.available-tags::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.available-tags::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}


/* Visibility Toggle Styles */
.visibility-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.visibility-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.visibility-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.visibility-option input[type="radio"]:checked ~ .visibility-info {
    color: #667eea;
}

.visibility-info {
    flex: 1;
}

.visibility-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.visibility-info p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input[type="radio"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input[type="radio"]:checked + .toggle-slider {
    background-color: #667eea;
}

input[type="radio"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Highlight the selected visibility option */
.visibility-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f0f2ff;
}

.visibility-option:has(input[type="radio"]:checked) .visibility-info h3 {
    color: #667eea;
}
