/**
 * Unit Converter Styles - Modern UI
 */

/* Container */
.ydmuc-container {
    max-width: 1000px;
    width: 100%;
    margin: 30px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease;
}

/* Title and Description */
.ydmuc-custom-title h3 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 1.6em;
    color: #333;
    font-weight: 600;
}

.ydmuc-custom-description p {
    margin-top: 0;
    margin-bottom: 25px;
    color: #555;
    font-size: 1.05em;
    line-height: 1.6;
}

/* Category Selector */
.ydmuc-category-selector {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f5f9ff;
    border-radius: 10px;
    border: 1px solid #d0e1f9;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ydmuc-category-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 18px;
    margin-right: 10px;
    flex: 0 0 auto;
}

.ydmuc-category-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 2px solid #d0e1f9;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.ydmuc-category-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Interaction Area */
.ydmuc-interaction-area {
    margin-bottom: 30px;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
}

.ydmuc-input-row,
.ydmuc-output-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.ydmuc-input-wrapper,
.ydmuc-select-wrapper {
    flex: 1;
    min-width: 120px;
}

.ydmuc-input-value,
.ydmuc-to-value {
    width: 90%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.ydmuc-input-value:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.ydmuc-to-value {
    background-color: #f5f9ff;
    border-color: #d0e1f9;
    font-weight: 600;
    color: #2c3e50;
}

.ydmuc-from-unit,
.ydmuc-to-unit {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.ydmuc-from-unit:focus,
.ydmuc-to-unit:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.ydmuc-to-unit {
    background-color: #f5f9ff;
    border-color: #d0e1f9;
}

.ydmuc-swap-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.ydmuc-swap-button {
    background-color: #f0f7ff;
    border: 2px solid #d0e1f9;
    border-radius: 50%;
    font-size: 20px;
    color: #4a90e2;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s ease;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ydmuc-swap-button:hover {
    background-color: #4a90e2;
    color: #fff;
    transform: rotate(180deg);
}

/* Results List */
.ydmuc-results-list {
    border-top: 1px solid #eee;
    padding-top: 25px;
    margin-top: 10px;
}

.ydmuc-result-group {
    margin-bottom: 25px;
}

.ydmuc-result-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.ydmuc-result-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.ydmuc-result-item {
    padding: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.ydmuc-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.ydmuc-result-item.ydmuc-highlighted {
    background-color: #f0f7ff;
    border-color: #90caf9;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.15);
}

.ydmuc-result-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.ydmuc-result-unit-name {
    color: #555;
    font-size:15px;
}

/* Error Messages */
.ydmuc-error,
.ydmuc-error-message {
    padding: 15px;
    margin-top: 15px;
    background-color: #fff5f5;
    border-left: 4px solid #e53e3e;
    color: #c53030;
    border-radius: 4px;
    font-size: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ydmuc-container {
        padding: 20px 15px;
        margin: 20px auto;
    }
    
    .ydmuc-interaction-area {
        padding: 15px;
    }
    
    .ydmuc-input-row,
    .ydmuc-output-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .ydmuc-input-wrapper,
    .ydmuc-select-wrapper {
        width: 100%;
        min-width: 100%;
    }
    
    .ydmuc-result-items {
        grid-template-columns: 1fr;
    }
    
    .ydmuc-swap-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 5px 0;
    }
    
    .ydmuc-custom-title h3 {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .ydmuc-container {
        padding: 15px 12px;
        border-radius: 8px;
    }
    
    .ydmuc-result-item {
        padding: 12px;
        
        align-items: flex-start;
        gap: 5px;
    }
    
    .ydmuc-result-value {
        font-size: 15px;
    }
    
    .ydmuc-result-unit-name {
        font-size:15px;
    }
}

/* RTL Support */
.rtl .ydmuc-error,
.rtl .ydmuc-error-message {
    border-left: none;
    border-right: 4px solid #e53e3e;
}

.rtl .ydmuc-from-unit,
.rtl .ydmuc-to-unit {
    background-position: left 15px center;
    padding-right: 15px;
    padding-left: 40px;
} 