/* Coffee Blend Mixer Styles */

.csm-blend-mixer-container {
    background: #fbf8f5;
    font-family: system-ui, sans-serif;
    color: #2b2316;
    padding: 1rem;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    max-width: 800px;
    margin: 2rem auto;
}

.csm-blend-mixer-wrapper {
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.csm-blend-title {
    text-align: center;
    font-size: 1.8rem;
    color: #7b543f;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Loading and Error States */
.csm-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.csm-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7b543f;
    border-radius: 50%;
    animation: csm-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes csm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.csm-error {
    text-align: center;
    padding: 2rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.csm-error-message {
    color: #dc2626;
    margin-bottom: 1rem;
}

/* Bean Selection */
.csm-select-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.csm-origin-select, .csm-size-select {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #e5e5e5;
    background: white;
    color: #2b2316;
    min-width: 200px;
}

.csm-origin-select:focus, .csm-size-select:focus {
    outline: none;
    border-color: #7b543f;
}

/* Buttons */
.csm-btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.csm-btn-primary {
    background: #7b543f;
    color: white;
}

.csm-btn-primary:hover:not(:disabled) {
    background: #ad8567;
}

.csm-btn-secondary {
    background: #6c757d;
    color: white;
}

.csm-btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.csm-btn-cart {
    background: #28a745;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 400px;
}

.csm-btn-cart:hover:not(:disabled) {
    background: #218838;
}

.csm-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Warnings */
.csm-warning {
    color: #e4572e;
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-weight: 500;
}

/* Blend Table */
.csm-blend-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 1rem;
    background: white;
}

.csm-blend-table th,
.csm-blend-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #efebe4;
    text-align: left;
    vertical-align: middle;
}

.csm-blend-table th {
    background: #f9f2e6;
    color: #7b543f;
    font-weight: 600;
    font-size: 1rem;
}

.csm-blend-table tr:last-child td {
    border-bottom: none;
}

.csm-section-label {
    font-weight: bold;
    color: #7b543f;
    background: #fbece0;
    padding: 0.5rem;
    text-align: center;
}

.csm-total-row th,
.csm-total-row td {
    font-weight: bold;
    background: #f4ede2;
    border-top: 2px solid #7b543f;
}

/* Bean Info */
.csm-bean-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.csm-bean-name {
    font-weight: 600;
    color: #2b2316;
}

.csm-bean-details {
    font-size: 0.9rem;
    color: #666;
}

.csm-bean-origins,
.csm-bean-background {
    font-size: 0.85rem;
    color: #888;
}

/* Sliders */
.csm-slider-container {
    width: 100%;
    padding: 1rem 0;
}

.csm-slider-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-radius: 0.7rem;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    transition: background 0.2s;
}

.csm-slider-controls.locked {
    background: #e7f9e7;
    border: 1px solid #8fe6a5;
}

.csm-percent-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #7b543f;
    min-width: 50px;
}

.csm-lock-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0.3rem 0.4rem;
    display: flex;
    align-items: center;
    min-width: 40px;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.csm-lock-btn.locked {
    color: #277b3b;
    background: #ccf9cc;
    border: 1.5px solid #8fe6a5;
}

.csm-lock-btn.unlocked {
    color: #ad8567;
    background: #f5eadd;
    border: 1.5px solid #f1dcc0;
}

.csm-lock-btn:active {
    filter: brightness(0.95);
}

input[type="range"] {
    width: 100%;
    accent-color: #7b543f;
    height: 12px;
    border-radius: 6px;
    appearance: none;
    background: #ddd;
    outline: none;
    cursor: pointer;
    margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7b543f;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7b543f;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

input[type="range"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Remove Button */
.csm-remove-btn {
    background: #e4572e;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.csm-remove-btn:hover {
    background: #b53614;
}

/* Size Selection */
.csm-size-selection {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9f7f5;
    border-radius: 8px;
    border: 1px solid #e5ddd5;
}

.csm-size-selection label {
    font-weight: 600;
    color: #7b543f;
    font-size: 1.1rem;
}

/* Price Display */
.csm-price-display {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9f7f5, #f4f1ed);
    border-radius: 12px;
    border: 2px solid #e5ddd5;
}

.csm-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.csm-price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.csm-total-price {
    border-top: 2px solid #7b543f;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: #7b543f;
}

/* Cart Section */
.csm-cart-section {
    text-align: center;
    margin-bottom: 2rem;
}

/* Instructions */
.csm-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.csm-instructions ul {
    margin: 0.5rem 0 0 1rem;
    padding-left: 1rem;
}

.csm-instructions li {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .csm-blend-mixer-container {
        margin: 1rem;
        padding: 0.5rem;
    }
    
    .csm-blend-mixer-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .csm-blend-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .csm-select-row {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .csm-origin-select {
        width: 100%;
        max-width: 300px;
    }
    
    .csm-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .csm-blend-table,
    .csm-blend-table th,
    .csm-blend-table td {
        font-size: 0.9rem;
    }
    
    .csm-blend-table th,
    .csm-blend-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Hide percentage column on mobile since it's shown above slider */
    .csm-percent-col {
        display: none;
    }
    
    .csm-slider-container {
        padding: 1.2rem 0;
    }
    
    input[type="range"] {
        height: 16px;
        margin: 0.75rem 0;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 38px;
        height: 38px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 38px;
        height: 38px;
    }
    
    .csm-percent-display {
        font-size: 1.3rem;
    }
    
    .csm-size-selection {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .csm-price-display {
        padding: 1rem;
    }
    
    .csm-instructions {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .csm-blend-mixer-container {
        margin: 0.5rem;
    }
    
    .csm-blend-mixer-wrapper {
        padding: 1rem 0.75rem;
    }
    
    .csm-blend-title {
        font-size: 1.3rem;
    }
    
    .csm-blend-table,
    .csm-blend-table th,
    .csm-blend-table td {
        font-size: 0.85rem;
    }
    
    .csm-slider-container {
        padding: 1.5rem 0;
    }
    
    input[type="range"] {
        height: 18px;
        margin: 1rem 0;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 42px;
        height: 42px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 42px;
        height: 42px;
    }
}

/* Animation for adding/removing beans */
@keyframes csm-fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.csm-bean-row {
    animation: csm-fadeIn 0.3s ease-out;
}

.csm-bean-row.removing {
    animation: csm-fadeOut 0.3s ease-out forwards;
}

@keyframes csm-fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}