/* SD Unit Converter Styles */
.sd-converter-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    position: relative;
    overflow: hidden;
}

.sd-converter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1;
}

.sd-converter-container > * {
    position: relative;
    z-index: 2;
}

.sd-converter-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.sd-converter-title {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.sd-converter-subtitle {
    font-size: 1.1em;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.sd-converter-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 5px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sd-tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #666;
    position: relative;
    overflow: hidden;
}

.sd-tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.sd-tab-button:hover::before {
    left: 100%;
}

.sd-tab-button.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.sd-tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.sd-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sd-converter-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.sd-converter-section h3 {
    font-size: 1.5em;
    margin: 0 0 25px 0;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.sd-conversion-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.sd-input-group {
    flex: 1;
    min-width: 200px;
}

.sd-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.sd-unit-select,
.sd-value-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.sd-unit-select:focus,
.sd-value-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.sd-unit-select {
    cursor: pointer;
}

.sd-result-input {
    background: #f8f9fa !important;
    font-weight: 600;
    color: #333;
}

.sd-conversion-arrow {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    margin: 0 10px;
    animation: pulse 2s infinite;
    align-self: center;
}

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

.sd-convert-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.sd-convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sd-convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sd-convert-btn:hover::before {
    left: 100%;
}

.sd-convert-btn:active {
    transform: translateY(0);
}

.sd-converter-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
}

.sd-converter-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sd-converter-footer a:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sd-converter-container {
        margin: 10px;
        padding: 20px;
        border-radius: 15px;
    }

    .sd-converter-title {
        font-size: 2em;
    }

    .sd-conversion-row {
        flex-direction: column;
        gap: 15px;
    }

    .sd-input-group {
        min-width: auto;
    }

    .sd-conversion-arrow {
        align-self: center;
        transform: rotate(90deg);
    }

    .sd-converter-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .sd-tab-button {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .sd-converter-container {
        padding: 15px;
    }

    .sd-converter-title {
        font-size: 1.8em;
    }

    .sd-converter-subtitle {
        font-size: 1em;
    }

    .sd-unit-select,
    .sd-value-input {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .sd-convert-btn {
        padding: 12px 25px;
        font-size: 1em;
    }
}

/* Option group styling */
.sd-unit-select optgroup {
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
}

.sd-unit-select option {
    font-weight: normal;
    color: #555;
    padding: 5px;
}

/* Loading animation */
.sd-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Success message */
.sd-success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #c3e6cb;
    display: none;
}

/* Error message */
.sd-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
    display: none;
}