@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #000000;
  --surface: rgba(25, 25, 25, 0.6);
  --surface-hover: rgba(40, 40, 40, 0.8);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-muted: #888888;
  --primary: #007aff;
  --primary-hover: #0062cc;
  --danger: #ff3b30;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Background Gradients */
.glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,122,255,0.15) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1000px;
  padding: 2rem;
  display: none;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.5s ease;
}

.container.active {
  display: flex;
}

/* Login Screen */
.login-box {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.5s ease;
}

.login-box.active {
  display: flex;
}

.login-box h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--primary);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.danger:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* Dashboard Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* Dashboard Cards */
.panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.panel h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

/* License Form */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

td {
  font-size: 0.95rem;
}

.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge.active {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
}

.badge.expired {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.close-btn {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}
.close-btn:hover { color: var(--text); }

/* Responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .container {
    padding: 1rem;
  }
  
  .panel {
    padding: 1.5rem;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  tr {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 0.5rem;
  }
  
  td {
    border: none;
    position: relative;
    padding-left: 40%;
    text-align: right;
    min-height: 40px;
  }
  
  td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    width: 35%;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
  }

  td > div {
    justify-content: flex-end;
  }
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
