/* PWA Creation - Drag and Drop Interface */
.drag-drop-container {
    display: flex;
    gap: 2rem;
    min-height: 600px;
    margin-top: 2rem;
}

.content-builder {
    flex: 1;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.content-builder.drag-over {
    border-color: #8b5cf6;
    background: #f3f4ff;
}

.builder-header {
    text-align: center;
    margin-bottom: 2rem;
}

.builder-header h3 {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.builder-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Drag and Drop Items */
.draggable-components {
    width: 280px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.components-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #374151;
}

.components-header svg {
    color: #8b5cf6;
}

.draggable-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.draggable-item:hover {
    background: #f3f4f6;
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drag-icon {
    color: #8b5cf6;
    flex-shrink: 0;
}

.drag-content {
    flex: 1;
}

.drag-title {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
}

.drag-description {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

/* Dropped Items in Builder */
.product-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.product-item.expanded {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
}

.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
}

.product-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.product-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.product-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-item:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.edit {
    background: #f0f9ff;
    color: #0369a1;
}

.action-btn.edit:hover {
    background: #0369a1;
    color: white;
}

.action-btn.delete {
    background: #fef2f2;
    color: #dc2626;
}

.action-btn.delete:hover {
    background: #dc2626;
    color: white;
}

.expand-icon {
    color: #6b7280;
    transition: transform 0.2s ease;
}

.product-item.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Product Content */
.product-content {
    display: none;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.product-item.expanded .product-content {
    display: block;
}

.content-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-field input,
.form-field select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Module Drop Zone */
.modules-drop-zone {
    background: #fafbfc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.modules-drop-zone.drag-over {
    border-color: #059669;
    background: #ecfdf5;
    color: #059669;
}

.modules-drop-zone svg {
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.module-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}

.module-item:hover {
    border-color: #059669;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.module-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #059669;
    font-weight: 500;
}

.module-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Lessons Drop Zone */
.lessons-drop-zone {
    background: #fefbf3;
    border: 2px dashed #fbbf24;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    color: #92400e;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.lessons-drop-zone.drag-over {
    border-color: #f59e0b;
    background: #fffbeb;
}

.lesson-item {
    background: white;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lesson-item:hover {
    border-color: #f59e0b;
}

.lesson-icon {
    color: #f59e0b;
    flex-shrink: 0;
}

.lesson-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.lesson-form input,
.lesson-form select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Submodule Layout - Flex Column */
.submodule-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submodule-field-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.submodule-name-field,
.submodule-type-field,
.submodule-content-field {
    display: flex;
    flex-direction: column;
}

.submodule-input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    width: 100%;
    transition: all 0.2s;
}

.submodule-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.submodule-textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    width: 100%;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    resize: vertical;
    min-height: 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.submodule-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.submodule-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.submodule-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.submodule-remove-btn {
    align-self: flex-start !important;
    margin-top: 0.5rem;
}

.submodule-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.content-input-container {
    margin-top: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.new-item {
    animation: slideIn 0.3s ease;
}

.drag-placeholder {
    border: 2px dashed #8b5cf6;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    text-align: center;
    color: #8b5cf6;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .drag-drop-container {
        flex-direction: column;
    }
    
    .draggable-components {
        width: 100%;
        order: -1;
    }
    
    .content-form {
        grid-template-columns: 1fr;
    }
    
    .module-form {
        grid-template-columns: 1fr;
    }
    
    .lesson-form {
        flex-direction: column;
    }
}

/* Success States */
.success-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-item.has-content .success-indicator {
    opacity: 1;
}

/* Content Stats */
.content-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
}

.stat-item strong {
    color: #374151;
}