/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-bg: #0f172a;
  --secondary-bg: #1e293b;
  --card-bg: #334155;
  --hover-bg: #475569;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  --border-color: #475569;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, var(--primary-bg) 0%, #1a202c 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: all 0.3s ease;
}

/* Light theme overrides */
body.light-theme {
  --primary-bg: #f8fafc;
  --secondary-bg: #f1f5f9;
  --card-bg: #ffffff;
  --hover-bg: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  background: linear-gradient(135deg, var(--primary-bg) 0%, #e2e8f0 100%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Controls */
.controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.control-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.control-btn:hover {
  background: var(--hover-bg);
  color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.control-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* Timezone Clocks */
.timezone-clocks {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.clock-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 140px;
  transition: all 0.3s ease;
}

.clock-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-blue);
}

.clock-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.clock-label i {
  color: var(--accent-blue);
  font-size: 0.75rem;
}

.clock-time {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
  letter-spacing: 0.5px;
}

.clock-date {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.time-display {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
  letter-spacing: 0.5px;
}

.date-display {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

.title {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.title i {
  color: var(--accent-blue);
  -webkit-text-fill-color: var(--accent-blue);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: 300;
}

/* Main content */
.main {
  flex: 1;
  padding: 2rem 0;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  transition: all 0.3s ease;
}

/* List layout */
.apps-grid.list-layout {
  grid-template-columns: 1fr;
  max-width: 600px;
}

.apps-grid.list-layout .app-card {
  justify-content: flex-start;
}

/* App cards */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.app-card:hover {
  transform: translateY(-4px);
  background: var(--hover-bg);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.app-card:hover::before {
  left: 100%;
}

/* Status indicators */
.app-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-indicator[data-status="online"] {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator[data-status="offline"] {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-indicator[data-status="checking"] {
  background: var(--accent-orange);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
  transform: scale(1.1);
}

/* Icon colors for each app */
.app-card[data-app="files"] .app-icon {
  background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
  color: white;
}

.app-card[data-app="docs"] .app-icon {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
}

.app-card[data-app="chat"] .app-icon {
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  color: white;
}

.app-card[data-app="tasks"] .app-icon {
  background: linear-gradient(135deg, var(--accent-orange), #d97706);
  color: white;
}

.app-info {
  flex: 1;
}

.app-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.app-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.app-last-accessed {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.8;
  font-style: italic;
}

.app-last-accessed:empty {
  display: none;
}

.app-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.app-card:hover .app-arrow {
  color: var(--accent-blue);
  transform: translateX(4px);
  opacity: 1;
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .timezone-clocks {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
  }

  .clock-item {
    min-width: auto;
    padding: 0.75rem 1rem;
  }

  .clock-time {
    font-size: 1.1rem;
  }

  .header {
    padding: 2rem 0 1.5rem;
  }

  .title {
    font-size: 2.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .app-card {
    padding: 1.25rem;
  }

  .app-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .app-name {
    font-size: 1.1rem;
  }

  .app-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }

  .app-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .app-arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}

/* Loading animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-card {
  animation: fadeInUp 0.6s ease forwards;
}

.app-card:nth-child(1) {
  animation-delay: 0.1s;
}
.app-card:nth-child(2) {
  animation-delay: 0.2s;
}
.app-card:nth-child(3) {
  animation-delay: 0.3s;
}
.app-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Accessibility */
.app-card:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .app-card {
    animation: none;
  }

  .app-card::before {
    display: none;
  }
}

/* Dark mode toggle support (future enhancement) */
@media (prefers-color-scheme: light) {
  :root {
    --primary-bg: #f8fafc;
    --secondary-bg: #f1f5f9;
    --card-bg: #ffffff;
    --hover-bg: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
  }

  body {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #e2e8f0 100%);
  }
}
