/* WordPress Garden Calculator Styles */
.garden-calculator-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a1f0a 0%, #1a3d1a 50%, #0f2a0f 100%);
    color: #e8f5e8;
    padding: 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
}

.garden-calculator-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(129, 199, 132, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.garden-calculator-wrapper {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 20px;
}

.calc-section {
    background: rgba(34, 51, 34, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #81c784;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Crop Selector */
.crop-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crop-button {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 50%, #388e3c 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
}

.crop-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(76, 175, 80, 0.5);
}

.input-label {
    color: #a5d6a7;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.base-value-input {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #000000 !important; /* ← force black text */
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.base-value-input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Mutations */
.mutations-container {
    display: grid;
    gap: 20px;
}

.mutation-group {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.mutation-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #a5d6a7;
}

.mutation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.mutation-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.2);
}

.mutation-option:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: scale(1.02);
}

.mutation-option.selected {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

.mutation-option input {
    margin: 0;
    transform: scale(1.2);
}

.mutation-label {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.mutation-multiplier {
    color: #81c784;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(76, 175, 80, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Toggle Switch for Max Mutation */
.mutation-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.mutation-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mutation-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000000;
    transition: all 0.3s ease;
    border-radius: 12px;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.mutation-toggle .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 2px;
    background-color: #e8f5e8;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.mutation-toggle input:checked + .slider {
    background-color: #eab308;
}

.mutation-toggle input:checked + .slider:before {
    transform: translateX(22px);
}

/* Weight and Quantity Section */
.weight-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.input-column {
    flex: 1;
    min-width: 150px;
}

/* Results Section */
.total-section {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%);
    border: 2px solid rgba(76, 175, 80, 0.6);
    position: relative;
    overflow: hidden;
}

.total-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 8s linear infinite;
    pointer-events: none;
}

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

.total-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.total-header {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.total-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.note-section {
    background: rgba(255, 255, 210, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
}

.note-icon {
    color: #ffeb3b;
    font-size: 1.2rem;
    margin-right: 8px;
}

.note-text {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 500;
}

.breakdown-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    color: #333;
}

.breakdown-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 12px;
}

.breakdown-item {
    font-size: 1rem;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
    font-weight: 500;
}

.breakdown-formula {
    font-weight: 700;
    color: #1b5e20;
    font-size: 1rem;
    margin-top: 8px;
    padding: 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(34, 51, 34, 0.95);
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #81c784;
}

.close-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e8f5e8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.search-container {
    margin-bottom: 16px;
}

.crop-search-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    color: #e8f5e8;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.crop-search-input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.crop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    overflow-y: auto;
    flex: 1;
    padding: 16px 8px 0 16px;
}

.crop-tile {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.crop-tile:hover {
    transform: scale(1.05);
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.crop-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin: 0 auto 12px;
    display: block;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.crop-name {
    font-weight: 600;
    color: #e8f5e8;
    font-size: 1rem;
}

.crop-value {
    color: #81c784;
    font-weight: 500;
    font-size: 0.9rem;
}

.loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #81c784;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(76, 175, 80, 0.3);
    border-left-color: #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .garden-calculator-container {
        padding: 16px;
    }
    
    .calc-section {
        padding: 16px;
    }
    
    .mutation-options {
        grid-template-columns: 1fr;
    }
    
    .total-value {
        font-size: 2.5rem;
    }
    
    .modal {
        padding: 16px;
        margin: 16px;
        max-width: 95%;
    }
    
    .crop-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
        padding: 12px 8px 0 12px;
    }
    
    .input-row {
        flex-direction: column;
    }
}

/* WordPress Theme Compatibility */
.garden-calculator-container * {
    box-sizing: border-box;
}

.garden-calculator-container input,
.garden-calculator-container button {
    font-family: inherit;
}

/* Custom scrollbar for modal */
.crop-grid::-webkit-scrollbar {
    width: 6px;
}

.crop-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.crop-grid::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.5);
    border-radius: 3px;
}

.crop-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 175, 80, 0.7);
}