* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; background: #f5f5f5; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

header { text-align: center; margin-bottom: 30px; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
header h1 { font-size: 2.5rem; margin-bottom: 10px; }
header p { font-size: 1.1rem; opacity: 0.9; }

main { display: grid; gap: 30px; }

.form-section, .list-section { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.form-section h2, .list-section h2 { margin-bottom: 20px; color: #444; border-bottom: 2px solid #667eea; padding-bottom: 10px; }

.settings-section { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border: 1px solid #dee2e6; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #667eea; }
.section-header h2 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

.btn { padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.3s; }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(102,126,234,0.3); }
.btn-secondary { background: #6c757d; color: white; }
.btn-search { background: #28a745; color: white; }
.btn-edit { background: #ffc107; color: #212529; }
.btn-danger { background: #dc3545; color: white; }

.search-box { display: flex; gap: 10px; margin-bottom: 20px; }
.search-box input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }

.prompts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.prompt-card { background: white; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; transition: all 0.3s; }
.prompt-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.prompt-card h3 { color: #333; margin-bottom: 10px; font-size: 1.2rem; }
.prompt-card .prompt-preview { color: #666; font-size: 0.9rem; margin-bottom: 10px; max-height: 60px; overflow: hidden; }
.prompt-card .prompt-meta { display: flex; justify-content: space-between; margin-top: 15px; padding-top: 10px; border-top: 1px solid #eee; font-size: 0.8rem; color: #888; }
.prompt-card .prompt-actions { display: flex; gap: 5px; margin-top: 10px; }
.prompt-card .prompt-actions .btn { padding: 5px 10px; font-size: 12px; }

.images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 5px; margin-bottom: 10px; }
.images-grid img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; transition: transform 0.2s; }
.images-grid img:hover { transform: scale(1.05); }

.upload-area { border: 2px dashed #667eea; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.3s; position: relative; }
.upload-area:hover { background: rgba(102,126,234,0.05); border-color: #764ba2; }
.upload-area input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-area p { color: #667eea; font-size: 14px; margin: 0; }

.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.upload-item { position: relative; width: 80px; height: 80px; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.upload-item button { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; background: #dc3545; color: white; border: none; border-radius: 50%; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.highlights-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding: 15px; background: #f8f9fa; border-radius: 8px; }
.highlight-word { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 20px; font-size: 14px; }
.highlight-word .count { background: rgba(255,255,255,0.3); padding: 2px 6px; border-radius: 10px; font-size: 11px; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); overflow-y: auto; }
.modal-content { background: white; margin: 5% auto; padding: 25px; border-radius: 10px; width: 80%; max-width: 600px; max-height: 80vh; overflow-y: auto; position: relative; animation: modalopen 0.3s; }
@keyframes modalopen { from { opacity: 0; transform: translateY(-50px); } to { opacity: 1; transform: translateY(0); } }
.close { position: absolute; right: 15px; top: 10px; color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.close:hover { color: #333; }

.existing-images-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.existing-image-item { position: relative; width: 80px; height: 80px; }
.existing-image-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.delete-image-btn { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; background: #dc3545; color: white; border: none; border-radius: 50%; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.image-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); cursor: pointer; }
.image-modal img { max-width: 90%; max-height: 85vh; margin: auto; display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); cursor: default; border-radius: 4px; }
.image-modal-close { position: absolute; top: 15px; right: 25px; color: #fff; font-size: 35px; font-weight: bold; cursor: pointer; z-index: 2001; }
.image-modal-nav { position: absolute; top: 50%; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 20px; transform: translateY(-50%); pointer-events: none; }
.image-modal-btn { background: rgba(255,255,255,0.2); color: white; border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 24px; cursor: pointer; pointer-events: auto; }
.image-modal-btn:hover { background: rgba(255,255,255,0.4); }
.image-modal-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-size: 14px; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 15px; }

.empty-state { text-align: center; padding: 40px; color: #666; }

.notification { position: fixed; top: 20px; right: 20px; padding: 15px 20px; border-radius: 5px; color: white; font-weight: 600; z-index: 3000; animation: slideIn 0.3s, fadeOut 0.3s 2.7s; }
.notification.success { background: #28a745; }
.notification.error { background: #dc3545; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

footer { text-align: center; margin-top: 40px; padding: 20px; color: #666; font-size: 0.9rem; }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .prompts-grid { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 10% auto; }
    header h1 { font-size: 2rem; }
    .search-box { flex-direction: column; }
    .section-header { flex-direction: column; gap: 10px; align-items: flex-start; }
}
