/* ============================================================
 *  PlayVidya — Global Styles
 * ============================================================ */

:root {
  --blue:      #2C3E50;
  --blue-light: #34495e;
  --orange:    #E67E22;
  --orange-light: #ecb676;
  --green:     #27AE60;
  --green-light: #52be80;
  --red:       #E74C3C;
  --purple:    #9B59B6;
  --gray:      #95A5A6;
  --bg:        #f0f4f8;
  --white:     #ffffff;
  --text-dark: #2C3E50;
  --text-muted: #778899;
  --border:    #e8edf2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--orange);
}

/* ──────────────────────────────────────────────────── */
/*  BUTTONS                                             */
/* ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange), #f39c12);
  color: white;
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(230, 126, 34, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #2ecc71);
  color: white;
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}
.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(39, 174, 96, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #e74c3c);
  color: white;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue), #34495e);
  color: white;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}
.btn-blue:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-dark);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ──────────────────────────────────────────────────── */
/*  BADGES & LABELS                                    */
/* ──────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background: rgba(39, 174, 96, 0.1);
  color: var(--green);
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.badge-warning {
  background: rgba(230, 126, 34, 0.1);
  color: var(--orange);
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.badge-danger {
  background: rgba(231, 76, 60, 0.1);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-info {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.badge-secondary {
  background: rgba(149, 165, 166, 0.1);
  color: var(--gray);
}

/* ──────────────────────────────────────────────────── */
/*  FORMS                                               */
/* ──────────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--blue);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: #f8fafd;
  outline: none;
  transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  background: white;
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f0f4f8;
  color: #a0b0c0;
  cursor: not-allowed;
}

input::placeholder,
textarea::placeholder {
  color: #b0bec5;
}

/* ──────────────────────────────────────────────────── */
/*  CARDS & CONTAINERS                                 */
/* ──────────────────────────────────────────────────── */

.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #445566;
}

/* ──────────────────────────────────────────────────── */
/*  TABLES                                              */
/* ──────────────────────────────────────────────────── */

.table-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbl-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f8fafd;
  border-bottom: 2px solid var(--border);
}

th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: #445566;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8fafd;
}

/* ──────────────────────────────────────────────────── */
/*  SPINNERS & LOADERS                                 */
/* ──────────────────────────────────────────────────── */

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.page-loader.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(230, 126, 34, 0.1);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ──────────────────────────────────────────────────── */
/*  EMPTY STATE                                         */
/* ──────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #a0b0c0;
  font-size: 0.9rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  text-align: center;
  margin-bottom: 16px;
}

.empty-state-action {
  margin-top: 16px;
}

/* ──────────────────────────────────────────────────── */
/*  TOAST NOTIFICATIONS                                */
/* ──────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-width: 300px;
  animation: slideInRight 0.3s ease;
}

.toast.success {
  border-left: 4px solid var(--green);
  color: var(--green);
}

.toast.error {
  border-left: 4px solid var(--red);
  color: var(--red);
}

.toast.warning {
  border-left: 4px solid var(--orange);
  color: var(--orange);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ──────────────────────────────────────────────────── */
/*  ANIMATIONS                                          */
/* ──────────────────────────────────────────────────── */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ──────────────────────────────────────────────────── */
/*  RESPONSIVE                                          */
/* ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  th, td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .card {
    padding: 14px;
    border-radius: 12px;
  }
}
