/**
 * 공통 기본 스타일
 * 모든 게임/학습 페이지에서 공통으로 사용되는 스타일
 */

/* 기본 변수 정의 */
:root {
  --main-color: #4f46e5;
  --sub-color: #22c55e;
  --accent-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-color: #ffffff;
  --text-color: #1f2937;
  --border-radius: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 공통 버튼 스타일 */
.common-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--main-color) 0%, #818cf8 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.common-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.common-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 공통 카드 스타일 */
.common-card {
  background: var(--card-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

/* 공통 로딩 스타일 */
.common-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 공통 모달 스타일 */
.common-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.common-modal.active {
  display: flex;
}

.common-modal-content {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 공통 경고 메시지 */
.common-warning {
  padding: 1rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  margin: 1rem 0;
}

.common-error {
  padding: 1rem;
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  color: #991b1b;
  margin: 1rem 0;
}

.common-success {
  padding: 1rem;
  background: #d1fae5;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  color: #065f46;
  margin: 1rem 0;
}

/* 사용량 표시 */
.usage-info {
  position: fixed;
  bottom: 60px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 999;
}

.usage-info.warning {
  background: rgba(239, 68, 68, 0.9);
}

/* 반응형 */
@media (max-width: 480px) {
  .common-card {
    padding: 1rem;
  }
  
  .common-modal-content {
    padding: 1.5rem;
  }
}
