/* Color Palette: #05386B, #379683, #5CDB95, #8EE4AF, #EDF5E1 */

:root {
  --primary-color: #05386B;
  --secondary-color: #379683;
  --accent-color: #5CDB95;
  --light-accent: #8EE4AF;
  --background-light: #EDF5E1;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --primary-color: #8EE4AF;
  --secondary-color: #5CDB95;
  --accent-color: #379683;
  --background-light: #1a1a1a;
  --text-dark: #ffffff;
  --text-light: #1a1a1a;
  --border-color: #333333;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
  transition: var(--transition);
}

/* Handmade/Sketch Style Elements */
.handmade-border {
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  position: relative;
}

.handmade-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--accent-color);
  border-radius: var(--border-radius);
  transform: rotate(-1deg);
  z-index: -1;
}

.sketch-shadow {
  box-shadow: 
    3px 3px 0 var(--secondary-color),
    6px 6px 0 var(--accent-color);
  transition: var(--transition);
}

.sketch-shadow:hover {
  transform: translate(-2px, -2px);
  box-shadow: 
    5px 5px 0 var(--secondary-color),
    8px 8px 0 var(--accent-color);
}

/* Navigation */
.navbar {
  background-color: var(--background-light) !important;
  border-bottom: 2px solid var(--border-color);
  transition: var(--transition);
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  color: var(--text-dark) !important;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--background-light) 0%, var(--light-accent) 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero-section h1 {
  color: var(--text-dark);
  font-weight: 800;
  letter-spacing: -1px;
}

.hero-section .text-primary {
  color: var(--primary-color) !important;
}

.hero-section .lead {
  color: var(--text-dark);
  font-size: 1.2rem;
}

/* Timer Card */
.timer-card {
  border: none;
  border-radius: var(--border-radius);
  background: var(--background-light);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.timer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Timer Display */
.time-circle {
  width: 250px;
  height: 250px;
  border: 8px solid var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--background-light) 0%, var(--light-accent) 100%);
  position: relative;
}

.time-circle::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border: 4px solid var(--secondary-color);
  border-radius: 50%;
  top: -10px;
  left: -10px;
  z-index: -1;
  transform: rotate(5deg);
}

.timer-text {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Courier New', monospace;
}

.time-info {
  margin-top: 1rem;
}

.time-info span {
  font-weight: 600;
  color: var(--primary-color);
}

/* Timer Controls */
.timer-controls .btn {
  min-width: 120px;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.timer-controls .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.timer-controls .btn:hover::before {
  left: 100%;
}

.btn-success {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-dark);
}

.btn-warning {
  background-color: #f39c12;
  border-color: #f39c12;
}

.btn-info {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-danger {
  background-color: #e74c3c;
  border-color: #e74c3c;
}

/* Statistics Cards */
.stat-card, .stat-item {
  padding: 1rem;
  background: var(--background-light);
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover, .stat-item:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.stat-card h6, .stat-item h6 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Chart Containers */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  background: var(--background-light);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-light);
  border-bottom: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

/* FAQ Section */
.accordion-item {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius) !important;
  margin-bottom: 1rem;
  background: var(--background-light);
}

.accordion-button {
  background: var(--background-light);
  color: var(--text-dark);
  border: none;
  font-weight: 600;
  padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
  background: var(--light-accent);
  color: var(--text-dark);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: var(--accent-color);
}

.accordion-body {
  background: var(--background-light);
  color: var(--text-dark);
  line-height: 1.7;
}

/* Modal Styles */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  background: var(--background-light);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-light);
  border-bottom: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-body {
  color: var(--text-dark);
}

/* Offcanvas Styles */
.offcanvas {
  background: var(--background-light);
  color: var(--text-dark);
}

.offcanvas-header {
  background: var(--primary-color);
  color: var(--text-light);
}

.technique-item {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-light);
  transition: var(--transition);
}

.technique-item:hover {
  border-color: var(--accent-color);
  transform: translateX(5px);
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--accent-color);
}

.alert-info {
  background: var(--light-accent);
  color: var(--text-dark);
}

.alert-light {
  background: var(--background-light);
  border-color: var(--secondary-color);
}

/* Ad Banner */
.ad-banner {
  min-height: 250px;
  background: var(--light-accent);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-weight: 500;
}

/* Footer */
footer {
  background: var(--primary-color) !important;
  color: var(--text-light);
}

footer a {
  color: var(--light-accent) !important;
}

footer a:hover {
  color: var(--accent-color) !important;
}

/* Dark Mode Toggle */
#darkModeToggle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark Mode Styles */
[data-theme="dark"] {
  background-color: #1a1a1a;
}

[data-theme="dark"] .navbar {
  background-color: #2c2c2c !important;
  border-bottom-color: #444;
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
}

[data-theme="dark"] .timer-card,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .stat-item,
[data-theme="dark"] .technique-item,
[data-theme="dark"] .accordion-item,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas {
  background-color: #2c2c2c;
  border-color: #444;
}

[data-theme="dark"] .time-circle {
  background: linear-gradient(135deg, #2c2c2c 0%, #3c3c3c 100%);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #3c3c3c;
}

[data-theme="dark"] .bg-light {
  background-color: #2c2c2c !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .timer-text {
    font-size: 2rem;
  }
  
  .time-circle {
    width: 200px;
    height: 200px;
  }
  
  .time-circle::before {
    width: 210px;
    height: 210px;
    top: -8px;
    left: -8px;
  }
  
  .timer-controls {
    flex-direction: column;
    gap: 0.5rem !important;
  }
  
  .timer-controls .btn {
    width: 100%;
    min-width: auto;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .hero-section .lead {
    font-size: 1rem;
  }
  
  .stat-card, .stat-item {
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .timer-text {
    font-size: 1.5rem;
  }
  
  .time-circle {
    width: 180px;
    height: 180px;
  }
  
  .hero-section {
    min-height: 50vh;
    padding: 2rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* Animation Classes */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(92, 219, 149, 0.3);
  outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-dark: #000000;
  }
  
  [data-theme="dark"] {
    --border-color: #ffffff;
    --text-dark: #ffffff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .timer-controls,
  .ad-banner,
  footer {
    display: none !important;
  }
  
  .timer-card,
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  body {
    background: white;
    color: black;
  }
}
