/* Base Styles */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #f72585;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --danger-color: #ef233c;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

[data-theme="dark"],
.dark-mode {
  --primary-color: #4895ef;
  --secondary-color: #560bad;
  --accent-color: #b5179e;
  --light-color: #212529;
  --dark-color: #f8f9fa;
  --success-color: #4361ee;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--light-color);
  color: var(--dark-color);
  transition: var(--transition);
  padding-top: 100px;
}

/* Header Styles */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--box-shadow);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  height: 50px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 1rem;
  flex-grow: 1;
  text-align: center;
}

.dark-mode-toggle {
  height: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card-group {
  margin-bottom: 2rem;
}

.card-group h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

/* Card Styles */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  border-top: 4px solid var(--primary-color);
}

[data-theme="dark"] .card {
  background: #2b2d42;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-group label {
  font-weight: normal;
  margin-bottom: 0;
}

/* Buttons */
.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-block;
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

/* Output Areas */
.output {
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(248, 249, 250, 0.5);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--success-color);
}

[data-theme="dark"] .output {
  background-color: rgba(43, 45, 66, 0.7);
}

/* Special Components */
.color-box {
  width: 100%;
  height: 100px;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.task-list {
  list-style: none;
  margin-top: 1rem;
}

.task-list li {
  padding: 0.75rem;
  background-color: rgba(248, 249, 250, 0.7);
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius);
  display: flex;
  justify-content: space-between;
}

[data-theme="dark"] .task-list li {
  background-color: rgba(43, 45, 66, 0.7);
}

.lightbulb {
  height: 100px;
  cursor: pointer;
  display: block;
  margin: 1rem auto;
  transition: var(--transition);
}

.lightbulb:hover {
  transform: scale(1.05);
}

.clock-display {
  font-size: 2rem;
  text-align: center;
  margin: 1rem 0;
  font-family: monospace;
  color: var(--primary-color);
}

.counter-display {
  font-size: 3rem;
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  border: 2px solid var(--primary-color);
}

/* Error Messages */
.error {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-content p {
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (min-width: 768px) {
  .card-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
  }

  .card {
    margin-bottom: 0;
  }

  h1 {
    font-size: 2rem;
  }
}
