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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  color: white;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h2 {
  color: white;
  margin: 30px 0 20px 0;
  font-size: 1.8em;
}

/* 입력 섹션 */
.input-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.url-input-wrapper {
  display: flex;
  gap: 10px;
}

.url-input-wrapper input {
  flex: 1;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.url-input-wrapper input:focus {
  outline: none;
  border-color: #667eea;
}

.url-input-wrapper button {
  padding: 12px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.url-input-wrapper button:hover {
  background: #5568d3;
}

.url-input-wrapper button:active {
  transform: scale(0.98);
}

/* OG 편집 폼 */
.og-edit-form {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.form-row {
  margin-bottom: 20px;
}

.form-group {
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  resize: vertical;
}

.image-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.image-input-wrapper input[type="text"] {
  flex: 1;
}

.upload-btn {
  padding: 12px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

.upload-btn:hover {
  background: #218838;
}

.upload-btn:active {
  transform: scale(0.98);
}

.upload-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.image-preview {
  margin: 20px 0;
}

.image-preview label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

#image-preview-container {
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
}

#image-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#youtube-preview {
  width: 100%;
  max-width: 100%;
  height: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.no-image {
  color: #999;
  font-style: italic;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

#save-btn {
  background: #667eea;
  color: white;
}

#save-btn:hover {
  background: #5568d3;
}

#cancel-btn {
  background: #e0e0e0;
  color: #555;
}

#cancel-btn:hover {
  background: #d0d0d0;
}

.form-actions button:active {
  transform: scale(0.98);
}

/* 목록 섹션 */
.list-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.og-list {
  display: grid;
  gap: 20px;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 40px;
  font-style: italic;
}

/* OG 아이템 카드 */
.og-item {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  transition: all 0.3s;
  background: #fafafa;
}

.og-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.og-item-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: #e0e0e0;
}

.og-item-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.og-item-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 100%;
}

.og-item-description {
  color: #666;
  line-height: 1.5;
  flex: 1;
}

.og-item-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9em;
  color: #999;
  margin-top: 10px;
}

.og-item-url {
  color: #667eea;
  text-decoration: none;
  word-break: break-all;
}

.og-item-url:hover {
  text-decoration: underline;
}

.og-item-type {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
}

.og-item-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.og-item-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-edit:hover {
  background: #5568d3;
}

.btn-delete {
  background: #e74c3c;
  color: white;
}

.btn-delete:hover {
  background: #c0392b;
}

/* 로딩 상태 */
.loading {
  text-align: center;
  padding: 20px;
  color: #667eea;
  font-weight: 600;
}

/* 반응형 */
@media (max-width: 768px) {
  .og-item {
    grid-template-columns: 1fr;
  }
  
  .og-item-image {
    height: 200px;
  }
  
  h1 {
    font-size: 2em;
  }
}

