/* Peptide Calculator Styles */
.peptide-calculator {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Options Section - Top */
.calculator-options {
    box-shadow: var(--peptide-box-shadow, rgba(0, 0, 0, 0.1) 0px 4px 6px);
    border-radius: var(--peptide-border-radius, 20px);
    padding: 30px;
    background: var(--peptide-secondary-color, #ffffff);
    margin-bottom: 30px;
}

.peptide-calculator-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 280px;
}

.column h2 {
    color: var(--peptide-primary-color, #5b66b9);
    margin-bottom: 15px;
    font-size: calc(var(--peptide-font-size, 16px) * 1.25);
    text-align: center;
}

.btn-container {
    display: flex;
    flex-flow: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.btn.peptide-btn {
    margin: 3px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: calc(var(--peptide-border-radius, 20px) / 3);
    cursor: pointer;
    font-size: calc(var(--peptide-font-size, 16px) * 0.875);
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--peptide-text-color, #333333);
    min-width: 50px;
}

.btn.peptide-btn:hover,
.btn.peptide-btn.active {
    background-color: var(--peptide-primary-color, #5b66b9);
    border-color: var(--peptide-primary-color, #5b66b9);
    color: var(--peptide-secondary-color, #ffffff);
    transform: translateY(-1px);
}

.peptide-input {
    width: 80%;
    margin-top: 10px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: calc(var(--peptide-border-radius, 20px) / 3);
    font-size: var(--peptide-font-size, 16px);
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

.peptide-input:focus {
    outline: none;
    border-color: var(--peptide-primary-color, #5b66b9);
    box-shadow: 0 0 0 3px rgba(91, 102, 185, 0.1);
}

.peptide-input::placeholder {
    color: var(--peptide-primary-color, #5b66b9);
}

.calculate-button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
    padding: 15px 20px;
    background-color: var(--peptide-primary-color, #5b66b9);
    color: var(--peptide-secondary-color, #ffffff);
    border: none;
    border-radius: calc(var(--peptide-border-radius, 20px) / 2);
    font-size: calc(var(--peptide-font-size, 16px) * 1.125);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.calculate-button:hover {
    background-color: color-mix(in srgb, var(--peptide-primary-color, #5b66b9) 90%, black);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 102, 185, 0.3);
}

.calculate-button:active {
    transform: translateY(0);
}

/* Results Section - Bottom */
.calculator-results {
    box-shadow: var(--peptide-box-shadow, rgba(0, 0, 0, 0.1) 0px 4px 6px);
    border-radius: var(--peptide-border-radius, 20px);
    padding: 30px;
    background: var(--peptide-secondary-color, #ffffff);
    text-align: center;
}

.calculator-results h3 {
    color: var(--peptide-primary-color, #5b66b9);
    margin-bottom: 20px;
    font-size: calc(var(--peptide-font-size, 16px) * 1.25);
}

.calculator-results p {
    margin: 15px 0;
    font-size: var(--peptide-font-size, 16px);
    color: var(--peptide-text-color, #333333);
    font-weight: 500;
}

.peptide-dose,
.draw-syringe,
.vial-doses,
.concentration {
    color: var(--peptide-primary-color, #5b66b9);
    font-weight: 700;
}

/* Syringe Container - Centers the syringe wrapper */
.syringe-container {
    position: relative;
    margin: 30px auto;
    width: 100%;
    max-width: 800px;
    height: 250px; /* Increased height for larger syringe */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Syringe Wrapper - Full width of parent container */
.syringe-wrapper {
    position: relative;
    width: 100%; /* Use full parent width */
    max-width: 800px; /* Maximum size limit */
    height: auto; /* Will match image height */
    display: inline-block;
}

/* Syringe image - fits exactly in wrapper */
.syringe-image {
    position: relative;
    z-index: 2; /* On top of liquid fill */
    width: 100%; /* Fill wrapper completely */
    height: auto;
    display: block;
}

/* Liquid fill - precisely positioned within syringe body boundaries */
.liquid-fill {
    position: absolute;
    top: 50%; /* Center vertically in wrapper */
    left: 14.7%; /* Start at body beginning: 204px/1385px = 14.7% */
    transform: translateY(-50%);
    width: 0%; /* Animated width */
    height: 80%; /* Height relative to wrapper - fills body completely */
    background: linear-gradient(90deg, 
        var(--peptide-primary-color, #5b66b9), 
        rgba(91, 102, 185, 0.8));
    border-radius: 0;
    transition: width calc(var(--peptide-animation-speed, 2s)) ease-in-out;
    z-index: 1; /* Behind syringe image */
    max-width: 73%; /* Maximum body width: (1385-204-170)/1385 = 73% */
    opacity: 0.9;
    overflow: hidden;
}

/* Remove progress bar that was causing the dot */
.progress-bar-background {
    display: none; /* Hide the progress bar that was causing the dot */
}

.progress-bar-fill {
    display: none; /* Hide the progress bar that was causing the dot */
}

/* Animation states - only liquid pulses, syringe stays still */
.syringe-wrapper.calculating .liquid-fill {
    animation: liquidPulse calc(var(--peptide-animation-speed, 2s)) infinite;
}

/* Enhanced animation keyframes */
@keyframes liquidPulse {
    0%, 100% { 
        opacity: 0.8; 
        filter: brightness(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.1);
    }
}

/* Removed syringePulse - no bouncing on syringe */

/* Smooth fill animation - handled in main liquid-fill class above */

.progress-bar-fill {
    transition: width calc(var(--peptide-animation-speed, 1s)) ease-out;
}

/* Filling animation effect */
.liquid-fill.animating {
    position: relative;
}

.liquid-fill.animating::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    animation: fillGlow calc(var(--peptide-animation-speed, 1s)) ease-out;
}

@keyframes fillGlow {
    0% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0.5); }
}

/* Responsive design */
@media (max-width: 1024px) {
    .peptide-calculator-grid {
        justify-content: center;
    }
    
    .column {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .peptide-calculator-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .column {
        width: 100%;
        max-width: 400px;
        min-width: auto;
    }
    
    .calculator-options,
    .calculator-results {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .syringe-container {
        height: 150px;
    }
    
    .syringe-wrapper {
        max-width: 600px; /* Limit max size on tablet */
    }
}

@media (max-width: 480px) {
    .peptide-calculator {
        margin: 10px;
    }
    
    .calculator-options,
    .calculator-results {
        padding: 15px;
    }
    
    .column h2 {
        font-size: calc(var(--peptide-font-size, 16px) * 1.1);
    }
    
    .btn.peptide-btn {
        padding: 6px 10px;
        font-size: calc(var(--peptide-font-size, 16px) * 0.8);
        min-width: 45px;
    }
    
    .peptide-input {
        width: 90%;
        padding: 8px 12px;
    }
    
    .calculate-button {
        padding: 12px 16px;
        font-size: var(--peptide-font-size, 16px);
    }
    
    .syringe-container {
        height: 120px;
    }
    
    .syringe-wrapper {
        max-width: 450px; /* Limit max size on mobile */
    }
}

/* Error states */
.peptide-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: calc(var(--peptide-font-size, 16px) * 0.875);
    margin-top: 5px;
    display: block;
}

/* Success animation */
.success-flash {
    animation: successFlash 0.6s ease-in-out;
}

@keyframes successFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(46, 204, 113, 0.1); }
}

/* Loading state */
.calculate-button.loading {
    position: relative;
    color: transparent;
}

.calculate-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Focus states for accessibility */
.btn.peptide-btn:focus,
.peptide-input:focus,
.calculate-button:focus {
    outline: 2px solid var(--peptide-primary-color, #5b66b9);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn.peptide-btn {
        border-width: 3px;
    }
    
    .btn.peptide-btn.active {
        border-width: 3px;
    }
}