/* Compost Calculator Core Styles */
body {
    font-family: 'League Spartan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
  }

  .achievement-celebration::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle, rgba(255,215,0,0.1) 10%, transparent 10%),
      radial-gradient(circle, rgba(255,215,0,0.1) 10%, transparent 10%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    pointer-events: none;
    animation: confetti 4s linear infinite;
    opacity: 0;
    z-index: 999;
    transition: opacity 0.3s ease;
  }
  
  .achievement-celebration.show::before {
    opacity: 1;
  }
  
  @keyframes confetti {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
  }

  
  .compost-calculator {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
  }
  
  .calculator-container {
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 12px;
    position: relative;
    background-color: transparent !important;
    box-shadow: none !important;
  }
  
  .input-group {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  /* Field and Input Styling */
  .input-field-group, .method-field-group {
    position: relative;
    margin-bottom: 10px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .input-field-group {
    padding: 20px;
    background-color: #455425; /* army green */
    color: #fef0e7; /* off white */
  }
  
  .method-field-group {
    padding: 0;
    background-color: #ace1fa; /* pale blue background */
    text-align: center;
  }
  
  .input-field {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fef0e7; /* off white */
    box-sizing: border-box;
  }
  
  .input-field::placeholder {
    color: rgba(254, 240, 231, 0.7); /* off white with opacity */
  }
  
  /* Selectors (Unit and Method) */
  .unit-selector, .method-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
  }
  
  .unit-selector {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 16px;
    color: #fef0e7; /* off white */
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fef0e7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
  }
  
  .method-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
    text-align: left;
    background-color: #fef0e7; /* light off-white */
    color: #2c3e50; /* dark navy */
    font-weight: bold;
    border: 2px solid #2c3e50;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
  }
  
  .method-select option {
    background-color: #fef0e7;
    color: #2c3e50;
    font-weight: normal;
  }
  
  /* Buttons */
  .button {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, background-color 0.3s;
    text-align: center;
    color: #2c3e50; /* dark navy text */
    margin-bottom: 10px;
    background-color: #ffc857; /* golden yellow for high contrast */
    border: 2px solid #2c3e50;
  }
  
  .button:hover {
    background-color: #f4b400; /* bold hover */
  }
  
  .button:active {
    transform: scale(0.98);
  }
  
  .button:disabled {
    background-color: #767676;
    cursor: not-allowed;
  }
  
  .button.add-location, .button.add-pile {
    background-color: #ffc857;
  }
  
  .button.add-location:hover, .button.add-pile:hover {
    background-color: #f4b400;
  }
  
  /* Location Status */
  .location-status {
    border-radius: 0;
    padding: 12px;
    margin: 0 0 10px 0;
    display: none;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background-color: #ace1fa; /* light blue */
  }
  
  .location-status.visible {
    display: block;
  }
  
  .location-detected {
    color: #483321; /* brown color */
    font-weight: bold;
  }
  
  .location-value {
    color: #1c5429; /* dark green */
    font-weight: normal;
  }
  
  /* Checkbox Styling */
  .custom-checkbox {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #fef0e7;
    border: 1px solid #483321;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 8px;
  }
  
  .custom-checkbox.checked:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #1c5429;
    border-radius: 2px;
    top: 3px;
    left: 3px;
  }
  
  .checkbox-label {
    display: flex;
    align-items: center;
    margin: 10px 0;
    cursor: pointer;
    font-size: 14px;
    color: #483321;
    background-color: #ace1fa; /* light blue */
    padding: 10px;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Results Container */
  .results-container {
    display: none;
    background-color: #483321; /* brown color */
    color: #fef0e7; /* off white */
    padding: 25px 20px;
    border-radius: 12px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .results-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #fef0e7; /* off white */
  }
  
  .results-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .result-item {
    background: #541b1e; /* dark red/brown */
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
  }
  
  .result-item:hover {
    transform: translateY(-5px);
  }
  
  .result-label {
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(254, 240, 231, 0.8); /* off white with opacity */
  }
  
  .result-value {
    font-size: 18px;
    font-weight: bold;
    color: #fef0e7; /* off white */
  }
  
  /* Loading Spinner */
  .loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fef0e7;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  /* Bin Selector */
  .bin-selector-container {
    background-color: #455425;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
  }
  
  .bin-options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  
  .bin-option {
    color: #fef0e7;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    font-size: 14px;
  }
  
  .bin-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .bin-option.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
  }
  
  /* Horizontal Slider */
  .horizontal-slider-container {
    margin: 15px 0;
    position: relative;
    height: 20px;
  }
  
  .slider-track-horizontal {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
  }
  
  .slider-thumb-horizontal {
    width: 20px;
    height: 20px;
    background-color: #fef0e7;
    border: 2px solid #1c5429;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  }
  
  /* Amount Display */
  .amount-display {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    width: 100%;
  }
  
  /* Size Indicator */
  .size-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
  }
  
  .indicator-icon {
    font-size: 20px;
    margin-right: 10px;
  }
  
  .indicator-text {
    color: #fef0e7;
    font-size: 14px;
  }
  
  /* Impact Preview */
  .impact-preview-container {
    background-color: #483321;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
  }
  
  .impact-preview-container.active {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 20px;
  }
  
  .impact-preview-title {
    color: #fef0e7;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    font-size: 16px;
  }
  
  .impact-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .preview-item {
    background-color: #541b1e;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
  }
  
  .preview-icon {
    font-size: 18px;
    margin-bottom: 5px;
  }
  
  .preview-label {
    color: rgba(254, 240, 231, 0.8);
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .preview-value {
    color: #fef0e7;
    font-weight: bold;
    font-size: 14px;
  }
  
  /* Achievement Progress */
  .achievement-progress,
  .achievement-progress-preview {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background-color: #2c3e50;
    color: #fef0e7;
  }
  
  .progress-label {
    color: #fef0e7;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
  }
  
  .progress-bar-container {
    height: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 5px;
  }
  
  .progress-bar {
    height: 100%;
    background: linear-gradient(to right, #ba3226, #ffc857);
    border-radius: 6px;
    transition: width 0.5s ease;
  }
  
  .progress-info {
    display: flex;
    justify-content: space-between;
    color: #ccc;
    font-size: 12px;
  }
  
  .achievement-progress-preview .progress-bar {
    opacity: 0.6; /* Dimmed for non-logged-in users */
  }
  
  .achievement-progress-preview.logged-in .progress-bar {
    opacity: 1; /* Full brightness for logged-in users */
  }
  
  .login-prompt {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
  
  .login-link {
    color: #ffc857;
    text-decoration: underline;
    font-weight: bold;
  }
  
  /* Achievement Notification */
  .achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 300px;
  }
  
  .achievement-notification.show {
    transform: translateX(0);
  }
  
  .achievement-emoji {
    font-size: 30px;
  }
  
  .achievement-content {
    flex: 1;
  }
  
  .achievement-title {
    font-weight: bold;
    color: #ffc857;
    margin-bottom: 5px;
  }
  
  .achievement-description {
    font-size: 12px;
    line-height: 1.4;
  }
  
  /* Achievement notification variants by rarity */
  .achievement-notification.common {
    background: linear-gradient(to right, #333, #5e1e00);
  }
  
  .achievement-notification.uncommon {
    background: linear-gradient(to right, #2c4c2c, #1c5429);
  }
  
  .achievement-notification.rare {
    background: linear-gradient(to right, #2c3c5c, #1c3478);
    box-shadow: 0 4px 15px rgba(100, 149, 237, 0.5);
  }
  
  .achievement-notification.epic {
    background: linear-gradient(to right, #4c2c5c, #7c1f99);
    box-shadow: 0 4px 15px rgba(186, 85, 211, 0.6);
  }
  
  .achievement-notification.legendary {
    background: linear-gradient(to right, #644800, #9e7210);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.7);
  }
  
  /* Special animations */
  @keyframes goldPulse {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  }
  
  .gold-pulse {
    animation: goldPulse 2s infinite;
  }
  
  /* Streak flame animation */
  @keyframes flameFlicker {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
  }
  
  .flame-icon {
    display: inline-block;
    animation: flameFlicker 2s infinite;
  }
  
  /* Badge styles */
  .badges-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .badge {
    width: 70px;
    height: 70px;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
  }
  
  /* Badge rarity styles */
  .badge.common {
    background-color: #3a3a3a;
  }
  
  .badge.uncommon {
    background-color: #2c4c2c;
  }
  
  .badge.rare {
    background-color: #2c3c5c;
    box-shadow: 0 0 8px rgba(100, 149, 237, 0.5);
  }
  
  .badge.epic {
    background-color: #4c2c5c;
    box-shadow: 0 0 12px rgba(186, 85, 211, 0.6);
  }
  
  .badge.legendary {
    background: linear-gradient(135deg, #3a1c00, #644800, #3a1c00);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  }
  
  .badge.locked {
    background-color: #333 !important;
    color: #555;
    filter: grayscale(100%);
    opacity: 0.5;
    box-shadow: none;
  }
  
  .badge:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 200, 87, 0.7);
  }
  
  .badge-tooltip {
    position: absolute;
    bottom: -75px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    width: 160px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
  }
  
  .badge:hover .badge-tooltip {
    opacity: 1;
  }
  
  .badge-title {
    font-weight: bold;
    color: #ffc857;
    margin-bottom: 3px;
  }
  
  .badge-description {
    font-size: 11px;
    color: #ddd;
  }
  
  .badge-rarity {
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffc857;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 5px;
    display: inline-block;
    font-weight: bold;
  }
  
  .badge-progress {
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    width: 100%;
  }
  
  .badge-progress-bar {
    height: 100%;
    background: #ffc857;
    border-radius: 2px;
  }
  
  .requirement-label {
    font-size: 10px;
    opacity: 0.7;
  }
  
  /* Achievement Dashboard */
  .achievement-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
  }
  
  .achievement-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    position: relative;
  }
  
  .achievement-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(255,255,255,0.2);
  }
  
  .achievement-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffc857;
  }
  
  .achievement-stat-label {
    font-size: 14px;
    color: #aaa;
  }
  
  .achievement-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
  }
  
  .achievement-tab {
    background: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
  }
  
  .achievement-tab:hover {
    background: #444;
    color: #fff;
  }
  
  .achievement-tab.active {
    background: #ba3226;
    color: white;
  }
  
  /* Dashboard impact cards */
  .impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .impact-card {
    background: #2c2c2c;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }
  
  .impact-icon {
    font-size: 28px;
    margin-bottom: 8px;
  }
  
  .impact-value {
    font-size: 24px;
    font-weight: bold;
    color: #ba3226;
  }
  
  .impact-label {
    font-size: 14px;
    color: #ccc;
  }
  
  /* Streak Section */
  .streak-section {
    background: linear-gradient(to right, #3a3a3a, #5e1e00);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
  }
  
  .streak-title {
    color: #a7e3fd;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
  }
  
  .streak-status {
    font-size: 18px;
    color: #ffc857;
  }
  
  /* Share Feature */
  .share-achievement {
    display: none;
    margin-top: 20px;
    text-align: center;
  }
  
  .share-button {
    background-color: #1DA1F2;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .share-button:hover {
    background-color: #0d8ad6;
  }
  
  /* Motivational message */
  .motivational-message {
    text-align: center;
    color: #ffc857;
    font-style: italic;
    margin: 10px 0 15px;
    font-size: 14px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
  
  /* No achievements message */
  .no-achievements-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-style: italic;
  }
  
  /* Achievement celebration overlay */
  @keyframes confetti {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
  }
  
  .achievement-celebration::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle, rgba(255,215,0,0.2) 10%, transparent 10%),
      radial-gradient(circle, rgba(255,215,0,0.2) 10%, transparent 10%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    pointer-events: none;
    animation: confetti 4s linear infinite;
    opacity: 0;
    z-index: 999;
  }
  
  .achievement-celebration.show::before {
    opacity: 1;
  }
  
  .achievement-celebration .badges-grid {
    animation: badgesPulse 2s ease-in-out;
  }
  
  @keyframes badgesPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  /* Responsive Styling */
  @media (min-width: 768px) {
    .calculator-container {
      max-width: 550px;
      padding: 25px;
    }
    
    .impact-preview-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @media (max-width: 480px) {
    .calculator-container {
      padding: 15px;
    }
    
    .input-field {
      padding: 10px;
    }
    
    .impact-preview-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .preview-item {
      padding: 8px;
    }
    
    .preview-icon {
      font-size: 16px;
    }
    
    .preview-value {
      font-size: 13px;
    }
    
    .bin-options {
      flex-direction: column;
      gap: 8px;
    }
    
    .bin-option {
      text-align: left;
    }
    
    .results-grid {
      grid-template-columns: 1fr;
    }
  }