:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --accent-color: #38bdf8;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --border-color: #334155;
  --error-color: #f43f5e;
  --success-color: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.container {
  width: 100%;
  max-width: 1100px;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  max-width: 120px;
  height: auto;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 1.5rem;
  color: var(--text-main);
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Base Card Styling */
.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
}

/* Default Mobile Styles: Only display the download box */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tasks-box {
  display: none; /* Hide active tasks on mobile */
}

/* Desktop/Laptop Styles (Screens >= 768px) */
@media (min-width: 768px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Left (Download) & Right (Tasks) */
    align-items: start;
  }

  .tasks-box {
    display: block; /* Show active tasks on desktop */
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #0f172a;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--accent-color);
}

.btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background-color: var(--accent-color);
  color: #000;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-card {
  background: #0f172a;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.task-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: bold;
}

.badge-youtube { background: #ef4444; color: #fff; }
.badge-twitter { background: #3b82f6; color: #fff; }
.badge-pixiv   { background: #0096fa; color: #fff; }

.task-progress {
  font-size: 0.85rem;
  color: var(--accent-color);
}

.task-card {
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.task-card:hover {
  border-color: var(--accent-color);
  background-color: #1e293b;
}

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* Modal Content Box */
.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: var(--text-main);
}

.close-btn {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-sub);
  cursor: pointer;
}

.close-btn:hover {
  color: var(--text-main);
}

/* Log Display Output */
.modal-log-body {
  background: #020617;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 1rem;
  border-radius: 6px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  flex-grow: 1;
  max-height: 60vh;
}

/* Top Bar / Logout Styling */
.top-bar {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 100;
}

.logout-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
}

.logout-btn:hover {
  background-color: var(--error-color);
  color: #fff;
}