/* Global Reset & Theme Variables */
:root {
  --bg-color: #0b0d19;
  --card-bg: rgba(20, 24, 46, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --glow-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

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

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

/* Beautiful Animated Background Gradients */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
  background-color: var(--bg-color);
}

/* Container Structure */
.app-container {
  width: 100%;
  max-width: 1200px;
  padding: 24px;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header styling */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: 20px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 30px;
}

.indicator.active {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Card glassmorphism */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Microphone Recorder Section */
.recorder-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 24px;
  flex-grow: 1;
}

.mic-button {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: var(--glow-shadow);
}

.mic-button:hover {
  transform: scale(1.05);
}

.mic-button:active {
  transform: scale(0.95);
}

/* Active Recording Pulsing rings */
.mic-button.recording {
  background: linear-gradient(135deg, var(--accent-pink), #ef4444);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
}

.pulse-ring, .pulse-ring-outer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-purple);
  opacity: 0;
  pointer-events: none;
}

.mic-button.recording .pulse-ring {
  animation: pulse 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  border-color: var(--accent-pink);
}

.mic-button.recording .pulse-ring-outer {
  animation: pulse-outer 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  border-color: var(--accent-pink);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulse-outer {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

.timer {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}

.status-text {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

/* Task list styling */
.task-list-wrapper {
  overflow-y: auto;
  max-height: 280px;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.task-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.task-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.badge {
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.badge.deadline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge.group {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Logs and Activity Monitor table */
.logs-card {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .logs-card {
    grid-column: span 1;
  }
}

.table-wrapper {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.logs-table th {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.logs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.platform-badge.voice { background: rgba(139, 92, 246, 0.2); color: #c084fc; }
.platform-badge.viber { background: rgba(124, 58, 237, 0.2); color: #a78bfa; }
.platform-badge.messenger { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.platform-badge.email { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.status-indicator.success { color: var(--success); }
.status-indicator.fail { color: #f87171; }

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Additional Elements: Input Wrapper & Event Preview Card */
.input-fallback-wrapper {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-top: 15px;
}

.input-fallback-wrapper input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-fallback-wrapper input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.btn-send {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.event-preview {
  margin-top: 20px;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(30, 36, 70, 0.7), rgba(20, 24, 46, 0.8));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-out;
}

.event-preview.hidden {
  display: none;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.preview-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-pink);
  letter-spacing: 0.5px;
}

.preview-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.preview-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.preview-time {
  font-size: 0.95rem;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 16px;
}

.btn-gcal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: #fff;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-gcal:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs for Schedule vs Tasks */
.tabs-header {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Events List in Right Card */
.events-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.event-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.event-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(2px);
}

.event-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.event-item-time {
  font-size: 0.82rem;
  color: var(--accent-blue);
  font-weight: 500;
}

.btn-item-gcal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-item-gcal:hover {
  background: var(--accent-purple);
  color: #fff;
  transform: translateY(-1px);
}

/* Tasks Interactive Actions */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  gap: 12px;
  transition: all 0.2s ease;
}

.task-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-purple);
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.btn-delete-task {
  background: none;
  border: none;
  color: #ef4444;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.btn-delete-task:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
}

/* Action button in logs table */
.btn-log-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-log-action:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* Header extras: sub-badge and trial-badge */
.sub-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-pink);
  margin-left: 8px;
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trial-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
}

.trial-badge.unlimited {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Dual Calendar Selection Box */
.calendar-options-box {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
}

.cal-choose-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.preview-actions-dual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-cal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-apple {
  background: #ffffff;
  color: #000000;
}

.btn-apple:hover {
  background: #e5e5e5;
  transform: translateY(-1px);
}

.btn-gcal {
  background: #4285f4;
  color: #ffffff;
}

.btn-gcal:hover {
  background: #3367d6;
  transform: translateY(-1px);
}

.event-actions-dual {
  display: flex;
  gap: 6px;
}

.btn-item-apple {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-item-apple:hover {
  background: #ffffff;
  color: #000;
}

.btn-delete-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-event:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.06);
}

.btn-clear-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-header:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Owner Auth & Login Modal */
.btn-login-header {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-login-header:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}

.owner-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-logout-tiny {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f87171;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}
.btn-logout-tiny:hover {
  background: #ef4444;
  color: #fff;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: all 0.2s ease;
}
.login-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}

.login-error {
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 12px;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Modal Backdrop & Card */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: linear-gradient(145deg, #181d38, #111428);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 30px;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.modal-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.price-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 18px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 12px;
  border-radius: 12px;
}

.price-currency {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fbbf24;
}

.price-amount {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.features-list {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
}

.btn-modal-close:hover {
  color: #fff;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
