/* Custom Styles for Leisurian Tools */

/* Root Variables */
:root {
    --primary-color: #5755d9;
    --secondary-color: #f1f3f4;
    --success-color: #32b643;
    --warning-color: #ffb700;
    --error-color: #e85600;
    --dark-color: #303742;
    --gray-color: #66758c;
    --light-gray: #f8f9fa;
    --border-radius: 0.4rem;
    --box-shadow: 0 0.25rem 1rem rgba(48, 55, 66, 0.15);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

/* Header Styles */
.navbar {
    background-color: #fff;
    border-bottom: 1px solid #e7e9ed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

/* Ensure navbar contents have proper horizontal spacing and alignment */
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
    opacity: 0.8;
}

.navbar-brand .icon {
    margin-right: 0.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4c51bf 100%);
    color: white;
    padding: 3rem 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-section {
    padding: 3rem 0;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Tool Cards */
.tool-card {
    border: 1px solid #e7e9ed;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: white;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 2rem rgba(48, 55, 66, 0.2);
    border-color: var(--primary-color);
}

.tool-card .card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: none;
}

.tool-card .card-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.tool-card .card-title .icon {
    margin-right: 0.75rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.tool-card .card-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.tool-card .card-body {
    padding: 0 1.5rem 1rem;
}

.tool-card .card-body p {
    margin-bottom: 0;
    color: var(--gray-color);
    line-height: 1.5;
}

.tool-card .card-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: none;
}

.tool-card .btn {
    transition: var(--transition);
    font-weight: 500;
}

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

/* Features Section */
.features-section {
    padding: 3rem 0;
    background-color: var(--light-gray);
    margin: 3rem -1rem 0;
}

.features-section .container {
    padding: 0 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem 1rem;
}

.feature-icon {
    margin-bottom: 1rem;
}

.feature-item h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.feature-item p {
    margin-bottom: 0;
    line-height: 1.5;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer p {
    color: #a0aec0;
    margin-bottom: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    margin-top: 2rem;
}

.footer .divider {
    border-color: #4a5568;
    margin: 2rem 0 1rem;
}

/* Responsive Design */
@media (max-width: 840px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .content-section {
        padding: 2rem 0;
    }
    
    .features-section {
        margin: 2rem -1rem 0;
    }
    
    .feature-item {
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tool-card .card-header,
    .tool-card .card-body,
    .tool-card .card-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .features-section .container {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

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

/* Focus States */
.btn:focus,
.navbar-brand:focus,
.footer-links a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .tool-card {
        border-width: 2px;
    }
    
    .hero {
        background: var(--dark-color);
    }
}

/* Form Input Hints - Minimal styling for Spectre compatibility */
.form-input-hint {
    font-size: 0.8rem;
    color: #acb3c2;
    margin-top: 0.2rem;
}


/* Print Styles */
@media print {
    .navbar,
    .hero,
    .footer {
        display: none;
    }
    
    .tool-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card,
    .panel,
    .tile {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Modern slider styling (scoped) */
.slider-wrap {
  position: relative;
  margin-top: 8px;
}

.slider-modern[type=range] {
  --percent: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
}

/* WebKit (Chrome, Edge, Safari) */
.slider-modern[type=range]::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(to right, #5755d9 var(--percent), #e6e6e6 var(--percent));
  border-radius: 999px;
}

.slider-modern[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 2px solid #5755d9;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(87, 85, 217, 0.15);
  margin-top: -7px; /* align thumb to track */
}

.slider-modern[type=range]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(87, 85, 217, 0.20);
}

.slider-modern[type=range]:focus {
  outline: none;
}

.slider-modern[type=range]:focus::-webkit-slider-thumb {
  border-color: #3037d7;
}

/* Firefox */
.slider-modern[type=range]::-moz-range-track {
  height: 8px;
  background: #e6e6e6;
  border-radius: 999px;
}

.slider-modern[type=range]::-moz-range-progress {
  height: 8px;
  background: #5755d9;
  border-radius: 999px;
}

.slider-modern[type=range]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 2px solid #5755d9;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(87, 85, 217, 0.15);
}

/* Value bubble above thumb */
.slider-bubble {
  position: absolute;
  top: -14px;
  left: var(--percent);
  transform: translateX(-50%);
  background: #5755d9; /* Spectre primary */
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* Running Pace Calculator Specific Styles */

/* Distance Unit Toggle */
.distance-unit-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Time Input Controls - Minimal styling for Spectre CSS compatibility */
.time-btn-up,
.time-btn-down {
  min-width: 2rem;
  height: 1.8rem;
}

/* Button Small Size Override */
.btn.btn-sm {
  height: 1.8rem;
}