/* WIA Talk - Conversation Phrases Styles */
/* Philosophy: 홍익인간 (弘益人間) - Benefit All Humanity */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5em;
  color: #667eea;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.2em;
  color: #764ba2;
  font-weight: 500;
  margin-bottom: 5px;
}

.description {
  font-size: 1em;
  color: #666;
  font-style: italic;
}

/* Toolbar */
.toolbar {
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toolbar-left, .toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f1f3f5;
  color: #495057;
  border: 2px solid #dee2e6;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #667eea;
}

.stats {
  display: flex;
  gap: 15px;
}

.stat-item {
  font-size: 0.95em;
  color: #495057;
}

.stat-item strong {
  color: #667eea;
  font-size: 1.2em;
}

/* Search & Filter */
.search-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  margin: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-bar {
  margin-bottom: 15px;
}

.search-bar input {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.1em;
  border: 2px solid #667eea;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
}

.search-bar input:focus {
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 16px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #495057;
}

.filter-tab:hover {
  border-color: #667eea;
  background: #f8f9fa;
}

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

/* Container */
.container {
  flex: 1;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Phrases Grid */
.phrases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.phrase-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.phrase-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.phrase-card.user-phrase {
  border: 2px solid #00b894;
}

.phrase-card.user-phrase::before {
  content: '✨ Custom';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #00b894;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 700;
}

.phrase-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.phrase-category {
  display: inline-block;
  padding: 6px 12px;
  background: #f1f3f5;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 600;
  color: #495057;
}

.phrase-actions {
  display: flex;
  gap: 5px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
}

.btn-icon:hover {
  transform: scale(1.2);
}

.phrase-content {
  margin-bottom: 15px;
}

.phrase-text {
  margin-bottom: 8px;
}

.phrase-korean {
  font-size: 1.3em;
  font-weight: 600;
  color: #2d3436;
  margin-bottom: 5px;
}

.phrase-english {
  font-size: 1em;
  color: #636e72;
  font-style: italic;
}

.phrase-gestures {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.9em;
  color: #495057;
}

.gesture-tag {
  display: inline-block;
  padding: 4px 8px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border-radius: 6px;
  margin-right: 5px;
  font-weight: 600;
  color: #667eea;
}

.phrase-footer {
  display: flex;
  gap: 10px;
}

.btn-small {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.9em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

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

.btn-practice:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.btn-edit {
  background: #fdcb6e;
  color: #2d3436;
}

.btn-edit:hover {
  background: #f9b90e;
}

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

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

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
  color: white;
  grid-column: 1 / -1;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px 30px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
}

.modal-close, .import-close {
  font-size: 2em;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.modal-close:hover, .import-close:hover {
  transform: scale(1.2);
}

.modal-body {
  padding: 30px;
}

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
}

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

.form-group small {
  display: block;
  margin-top: 5px;
  color: #95a5a6;
  font-size: 0.85em;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 2px solid #e9ecef;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Import Modal */
.import-options {
  margin-bottom: 20px;
}

.import-option {
  display: block;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.import-option:hover {
  background: #e9ecef;
}

.import-option input[type="radio"] {
  margin-right: 10px;
}

.file-drop-zone {
  border: 3px dashed #dee2e6;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-drop-zone:hover {
  border-color: #667eea;
  background: #f8f9fa;
}

.file-drop-zone.drag-over {
  border-color: #00b894;
  background: rgba(0, 184, 148, 0.1);
}

.import-preview {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.import-preview pre {
  background: #2d3436;
  color: #00b894;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.85em;
  overflow-x: auto;
}

/* Footer */
footer {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 0.9em;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 5px 0;
}

footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }

  .phrases-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left, .toolbar-right {
    flex-direction: column;
    width: 100%;
  }

  .filter-tabs {
    flex-direction: column;
  }

  .filter-tab {
    width: 100%;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }
}
