/* ML to Gram Converter - Styles */

.mlg-converter-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.mlg-converter-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Section */
.mlg-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.mlg-title {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.mlg-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
}

/* Form Section */
.mlg-converter-form {
    padding: 40px 30px;
}

.mlg-form-group {
    margin-bottom: 24px;
}

.mlg-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mlg-label-icon {
    font-size: 18px;
}

.mlg-input,
.mlg-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    background: white;
    color: #2d3748;
    font-weight: 500;
}

.mlg-select option {
    color: #2d3748;
    font-weight: 500;
    padding: 10px;
    background: white;
}

.mlg-select option:hover {
    background: #f7fafc;
}

.mlg-input:focus,
.mlg-select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.mlg-input::placeholder {
    color: #a0aec0;
}

/* Density Input Wrapper */
.mlg-density-input-wrapper {
    display: flex;
    gap: 12px;
}

.mlg-density-input {
    flex: 2;
}

.mlg-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d3748' 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 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.mlg-select:hover {
    border-color: #cbd5e0;
    background-color: #f7fafc;
}

.mlg-density-unit {
    flex: 1;
    min-width: 120px;
}

/* Density Display */
.mlg-density-display {
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 24px;
}

.mlg-density-display strong {
    color: #06b6d4;
    font-weight: 600;
}

/* Buttons */
.mlg-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.mlg-btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    margin-bottom: 12px;
}

.mlg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(6, 182, 212, 0.4);
}

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

.mlg-btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.mlg-btn-secondary:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

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

.mlg-btn-icon {
    font-size: 20px;
}

/* Result Section */
.mlg-result-section {
    margin: 30px 0;
    animation: slideIn 0.5s ease;
}

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

.mlg-result-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 2px solid #06b6d4;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Action Buttons Container */
.mlg-action-buttons {
    margin-top: 20px;
}

.mlg-btn-fullwidth {
    width: 100%;
}

.mlg-btn-action {
    background: white;
    color: #0891b2;
    border: 2px solid #06b6d4;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.mlg-btn-action:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-color: #0891b2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
}

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

.mlg-result-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.mlg-result-content {
    flex: 1;
}

.mlg-result-label {
    font-size: 14px;
    color: #718096;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mlg-result-value {
    font-size: 36px;
    font-weight: 700;
    color: #0891b2;
    margin-bottom: 8px;
}

.mlg-result-formula {
    font-size: 14px;
    color: #4a5568;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* Information Section */
.mlg-info-section {
    padding: 40px 30px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.mlg-info-title {
    color: #2d3748;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mlg-info-list {
    margin: 0 0 30px 0;
    padding-left: 20px;
    color: #4a5568;
    line-height: 1.8;
}

.mlg-info-list li {
    margin-bottom: 8px;
}

.mlg-formula-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #2d3748;
    text-align: center;
    font-weight: 600;
    margin-bottom: 30px;
}

/* Density Table */
.mlg-density-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.mlg-density-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.mlg-density-row:last-child {
    border-bottom: none;
}

.mlg-density-row:hover {
    background: #f7fafc;
}

.mlg-density-ingredient {
    color: #2d3748;
    font-weight: 600;
}

.mlg-density-value {
    color: #0891b2;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mlg-converter-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .mlg-header {
        padding: 30px 20px;
    }
    
    .mlg-title {
        font-size: 24px;
    }
    
    .mlg-subtitle {
        font-size: 14px;
    }
    
    .mlg-converter-form,
    .mlg-info-section {
        padding: 30px 20px;
    }
    
    .mlg-result-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .mlg-result-value {
        font-size: 28px;
    }
    
    .mlg-density-input-wrapper {
        flex-direction: column;
    }
    
    .mlg-density-unit {
        width: 100%;
    }
    
    .mlg-action-buttons {
        margin-top: 15px;
    }
    
    .mlg-btn-action {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Loading State */
.mlg-btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.mlg-btn-primary.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
}

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

/* Error State */
.mlg-input.error,
.mlg-select.error {
    border-color: #fc8181;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success Animation */
.mlg-result-section.success {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-20px);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
