/*
 * Level Tool - Mobile Precision Leveling Application (Stylesheet)
 * Copyright (c) 2025 Jay Blankenship. All rights reserved worldwide.
 * 
 * PROPRIETARY AND CONFIDENTIAL SOFTWARE
 * 
 * This stylesheet and all associated design elements, animations, and visual
 * components are protected intellectual property and trade secrets.
 * 
 * RESTRICTIONS:
 * - No unauthorized copying, reproduction, or distribution
 * - No reverse engineering or extraction of design patterns
 * - No modification or derivative works
 * - No commercial use without explicit written license
 * - No removal or alteration of copyright notices
 * 
 * Protected under US Copyright Law, international treaties, and patent pending.
 * Commercial licensing available. Contact: jayblankenship@outlook.com
 */

/* Sensor info message */
.sensor-info {
    background: #fffbe6;
    color: #333;
    border: 1px solid #ffe58f;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    position: relative;
}


.level-svg {
    width: 300px;
    height: 300px;
    max-width: 80vw;
    max-height: 80vw;
    display: block;
    transition: filter 0.2s, background 0.2s;
}

.level-green circle,
.level-green line,
.level-green .degree-marks line {
    stroke: #43e943 !important;
}
.level-green .bubble {
    stroke: #fff !important;
    fill: #43e943 !important;
}
.level-green {
    filter: drop-shadow(0 0 20px #43e94388);
}

.bubble {
    transition: all 0.1s ease-out;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.readings {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 300px;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.reading-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 500;
    color: #555;
}

.value {
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
}

.status {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status.level {
    background: #4CAF50;
    color: white;
}

.status.not-level {
    background: #FF5722;
    color: white;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.3);
}

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

.error-message {
    background: #f44336;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

/* Flash effect when level - green background with neon green flash */
.flash-level {
  background: linear-gradient(135deg, #43e943 0%, #2ecc40 50%, #27ae60 100%) !important;
  animation: flash-green 0.5s ease-in-out infinite;
}

@keyframes flash-green {
  0% { 
    background: linear-gradient(135deg, #43e943 0%, #2ecc40 50%, #27ae60 100%) !important;
    box-shadow: inset 0 0 50px rgba(67, 233, 67, 0.3);
  }
  50% { 
    background: linear-gradient(135deg, #00ff00 0%, #43e943 50%, #2ecc40 100%) !important;
    box-shadow: inset 0 0 50px rgba(0, 255, 0, 0.5);
  }
  100% { 
    background: linear-gradient(135deg, #43e943 0%, #2ecc40 50%, #27ae60 100%) !important;
    box-shadow: inset 0 0 50px rgba(67, 233, 67, 0.3);
  }
}

/* Precision Control Menu */
.precision-control {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 500px;
}

.precision-control h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
}

.precision-slider-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.precision-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.precision-input-container label {
  margin: 0;
}

.precision-input {
  width: 60px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: #4CAF50;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.precision-input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
  background: white;
}

.precision-input:invalid {
  border-color: #FF5722;
  color: #FF5722;
}

.precision-input-container span {
  font-size: 1.1rem;
  color: #333;
}

.precision-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, #4CAF50 0%, #FFC107 50%, #FF5722 100%);
  outline: none;
  opacity: 0.8;
  transition: opacity 0.3s;
  cursor: pointer;
}

.precision-slider:hover {
  opacity: 1;
}

.precision-slider::-webkit-slider-thumb {
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #f0f0f0);
  border: 3px solid #4CAF50;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.precision-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

.precision-slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #f0f0f0);
  border: 3px solid #4CAF50;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.precision-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #666;
  margin-top: -5px;
}

@media (max-width: 480px) {
  .precision-control {
    padding: 15px;
    margin: 15px auto;
  }
  
  .precision-labels {
    font-size: 0.8rem;
  }
}

/* Ad Banner Styles */
.ad-banner-top, .ad-banner-bottom {
  width: 100%;
  max-width: 100vw;
  height: 90px;
  margin: 15px auto;
  text-align: center;
  display: block;
  background: #f5f5f5;
  border: 1px solid #ddd;
}

.ad-banner-top {
  margin-top: 10px;
  margin-bottom: 20px;
}

.ad-banner-bottom {
  margin-top: 20px;
  margin-bottom: 80px; /* Account for footer */
}

/* Make sure ads fill their containers */
.adsbygoogle {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .level-svg {
        width: 250px;
        height: 250px;
    }
    
    .level-container {
        padding: 15px;
    }
    
    .readings {
        padding: 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-width: 100px;
    }
}

@media (max-width: 320px) {
    .level-svg {
        width: 200px;
        height: 200px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .level-svg {
        width: 200px;
        height: 200px;
    }
    
    .level-container {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    .readings {
        padding: 15px;
        margin-bottom: 15px;
    }
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #a1c4fd 100%);
    min-height: 100vh;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.5s;
}