/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.header .logo {
  height: 56px;
  width: auto;
}

.brand-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.header h1 {
  font-size: 2.5rem;
  color: #1a73e8;
  margin-bottom: 8px;
}

.tagline {
  color: #666;
  font-size: 1.1rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #333;
}

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

.card-header h2 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* User card */
.user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  flex-direction: column;
}

#user-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.sync-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background-color: #1a73e8;
  color: white;
}

.btn-primary:hover {
  background-color: #1557b0;
}

.btn-secondary {
  background-color: #e8eaed;
  color: #333;
}

.btn-secondary:hover {
  background-color: #dadce0;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

/* Text utilities */
.text-muted {
  color: #666;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-group small {
  display: block;
  margin-top: 4px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
}

/* Color picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  border-color: #333;
}

/* Google Calendar colors */
.color-1 { background-color: #7986cb; }  /* Lavender */
.color-2 { background-color: #33b679; }  /* Sage */
.color-3 { background-color: #8e24aa; }  /* Grape */
.color-4 { background-color: #e67c73; }  /* Flamingo */
.color-5 { background-color: #f6bf26; }  /* Banana */
.color-6 { background-color: #f4511e; }  /* Tangerine */
.color-7 { background-color: #039be5; }  /* Peacock */
.color-8 { background-color: #616161; }  /* Graphite */
.color-9 { background-color: #3f51b5; }  /* Blueberry */
.color-10 { background-color: #0b8043; } /* Basil */
.color-11 { background-color: #d50000; } /* Tomato */

/* Rules list */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  gap: 12px;
}

.rule-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rule-info {
  flex: 1;
}

.rule-name {
  font-weight: 500;
}

.rule-conditions {
  font-size: 0.85rem;
  color: #666;
}

.rule-actions {
  display: flex;
  gap: 8px;
}

.rule-disabled {
  opacity: 0.5;
}

/* Conditions */
.condition-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.condition-row select {
  width: auto;
  padding: 8px;
}

.condition-row input {
  flex: 1;
}

.condition-remove {
  padding: 8px;
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.modal-content form {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Sync status */
#sync-status {
  padding: 16px;
}

#sync-status.success {
  background-color: #d4edda;
  border-color: #c3e6cb;
}

#sync-status.error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

#sync-status.info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* Feedback */
.feedback-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.feedback-card h2,
.feedback-card label {
  color: white;
}

.feedback-card .text-muted {
  color: rgba(255, 255, 255, 0.8);
}

.feedback-card input,
.feedback-card textarea {
  background: rgba(255, 255, 255, 0.9);
}

.feedback-card .btn-primary {
  background-color: white;
  color: #667eea;
}

.feedback-card .btn-primary:hover {
  background-color: #f0f0f0;
}

#feedback-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
  .user-card {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .sync-info {
    width: 100%;
    justify-content: space-between;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .condition-row {
    flex-wrap: wrap;
  }

  .condition-row select {
    width: 100%;
  }
}

/* Site Footer */
.site-footer {
  text-align: center;
  padding: 30px 20px;
  margin-top: 40px;
  color: #666;
  font-size: 14px;
}

.site-footer a {
  color: #666;
  text-decoration: none;
}

.site-footer a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

.site-footer .separator {
  margin: 0 10px;
}
