/**
 * FG Base Converter 样式
 */

/* 容器 */
.fg-base-converter-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

/* 标题和描述 */
.fg-base-converter-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.fg-base-converter-description {
    margin-bottom: 20px;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

/* 表单布局 */
.fg-base-converter-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* 输入区 */
.fg-base-converter-input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9f9f9;
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fg-base-converter-input-group {
    width: 100%;
}

/* 选择框和切换按钮行 */
.fg-base-converter-controls-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 10px;
    gap: 15px;
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #efefef;
}

.fg-base-converter-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 标签样式优化 */
.fg-base-converter-select-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 15px;
}

/* 输入和输出字段 */
.fg-base-converter-input,
.fg-base-converter-output,
.fg-base-converter-from-base,
.fg-base-converter-to-base {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.fg-base-converter-input:focus,
.fg-base-converter-output:focus,
.fg-base-converter-from-base:focus,
.fg-base-converter-to-base:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.fg-base-converter-input {
    font-family: monospace;
    font-size: 17px;
}

.fg-base-converter-input::placeholder {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.fg-base-converter-input:focus::placeholder {
    opacity: 0.4;
}

.fg-base-converter-output {
    background-color: #f5f8fa;
    font-family: monospace;
    font-size: 17px;
    font-weight: 500;
    cursor: default;
    user-select: all;
}

/* 增强选择框样式 */
.fg-base-converter-from-base,
.fg-base-converter-to-base {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 30px;
}

.fg-base-converter-from-base:hover,
.fg-base-converter-to-base:hover {
    border-color: #b4b9be;
    background-color: #f8f9fa;
}

/* 错误信息 */
.fg-base-converter-error-message {
    color: #d63638;
    font-size: 14px;
    margin-top: 6px;
    min-height: 18px;
    padding: 0 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* 增强错误消息显示 */
.fg-base-converter-error-message:not(:empty) {
    background-color: rgba(214, 54, 56, 0.05);
    border-left: 3px solid #d63638;
    padding: 6px 10px;
    margin-top: 8px;
    animation: fadeIn 0.2s ease-out;
}

/* 切换按钮 */
.fg-base-converter-switch-btn {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 15px;
    margin-bottom: 10px;
}

.fg-base-converter-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fg-base-converter-switch:hover {
    background: #006ba1;
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.fg-base-converter-switch:focus {
    outline: none;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba;
}

.fg-base-converter-switch:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Dashicons */
.fg-base-converter-switch .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
}

/* 输出区 */
.fg-base-converter-output-area {
    margin-top: 5px;
    padding: 18px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fg-base-converter-output-group {
    width: 100%;
}

/* 结果展示区 */
.fg-base-converter-results-area,
.fg-base-converter-twos-complement-area {
    margin-top: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.fg-base-converter-results-area h4,
.fg-base-converter-twos-complement-area h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
}

.fg-base-converter-results-area h4::before,
.fg-base-converter-twos-complement-area h4::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 18px;
    background-color: #007cba;
    margin-right: 8px;
    border-radius: 3px;
}

.fg-base-converter-results-list,
.fg-base-converter-twos-complement-list {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 0!important;
}

.fg-base-converter-result-item,
.fg-base-converter-twos-complement-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.fg-base-converter-result-item:hover {
    background-color: #f3f5f7;
    border-radius: 4px;
    padding-left: 6px;
    padding-right: 6px;
}

.fg-base-converter-result-item:last-child,
.fg-base-converter-twos-complement-item:last-child {
    border-bottom: none;
}

.fg-base-converter-result-label,
.fg-base-converter-twos-complement-label {
    flex: 0 0 180px;
    font-weight: 500;
    color: #444;
    transition: all 0.3s ease;
}

.fg-base-converter-result-value,
.fg-base-converter-twos-complement-value {
    flex: 1;
    font-family: monospace;
    overflow-wrap: break-word;
    word-break: break-all;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.fg-base-converter-result-item:hover .fg-base-converter-result-value {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 复制按钮 */
.fg-base-converter-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    padding: 6px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    min-width: 32px;
    min-height: 32px;
}

.fg-base-converter-copy-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fg-base-converter-copy-btn:focus {
    outline: none;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007cba;
}

.fg-base-converter-copy-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.fg-base-converter-copy-btn.copied {
    background: #e8f6e9;
    border-color: #46b450;
    color: #46b450;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .fg-base-converter-container {
        padding: 15px;
        margin: 10px auto;
    }
    
    .fg-base-converter-input-area,
    .fg-base-converter-output-area,
    .fg-base-converter-results-area,
    .fg-base-converter-twos-complement-area {
        padding: 15px;
    }
}

@media (max-width: 600px) {
    .fg-base-converter-form {
        gap: 15px;
    }
    
    .fg-base-converter-input-area {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .fg-base-converter-controls-row {
        flex-direction: row;
        align-items: flex-end;
        padding: 12px;
        gap: 10px;
    }
    
    .fg-base-converter-select-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .fg-base-converter-switch-btn {
        padding: 0 8px;
        margin-bottom: 10px;
    }
    
    .fg-base-converter-switch {
        padding: 10px;
    }
    
    /* 在小屏幕上保持水平方向图标 */
    .fg-base-converter-switch .dashicons {
        transform: none;
    }
    
    .fg-base-converter-result-item,
    .fg-base-converter-twos-complement-item {
        flex-wrap: wrap;
        padding: 12px 8px;
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 6px;
        border: 1px solid #eee;
    }
    
    .fg-base-converter-result-label,
    .fg-base-converter-twos-complement-label {
        flex: 1 0 100%;
        margin-bottom: 6px;
        font-size: 14px;
        display: flex;
        align-items: center;
    }
    
    .fg-base-converter-result-value,
    .fg-base-converter-twos-complement-value {
        flex: 1;
        font-size: 14px;
        background: #fff;
        border: 1px solid #e0e0e0;
    }
    
    .fg-base-converter-copy-btn {
        margin-left: 8px;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .fg-base-converter-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .fg-base-converter-switch-btn {
        padding: 5px 0;
        margin: 0;
     
    }
    
    .fg-base-converter-switch {
        transform: rotate(90deg);
        width: 15%;
        border-radius: 6px;
        padding: 8px 0;
    }
}

/* 管理页面样式 */
.fg-base-converter-shortcode-example {
    background: #f7f7f7;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-family: monospace;
    overflow: auto;
}

/* 添加动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 为输入框添加微妙边框变化效果 */
.fg-base-converter-input:not(:focus):hover,
.fg-base-converter-from-base:not(:focus):hover,
.fg-base-converter-to-base:not(:focus):hover {
    border-color: #b0b5bb;
}

/* 标签 */
.fg-base-converter-input-group label,
.fg-base-converter-output-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
    font-size: 15px;
}

@media (max-width: 400px) {
    .fg-base-converter-container {
        padding: 10px;
    }
    
    .fg-base-converter-title {
        font-size: 20px;
    }
    
    .fg-base-converter-input,
    .fg-base-converter-output,
    .fg-base-converter-from-base,
    .fg-base-converter-to-base {
        padding: 8px;
        font-size: 14px;
    }
    
    .fg-base-converter-result-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 8px;
        margin-bottom: 10px;
    }
    
    .fg-base-converter-result-label,
    .fg-base-converter-twos-complement-label {
        width: 100%;
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .fg-base-converter-result-value {
        width: 83%;
        font-size: 13px;
        margin-bottom: 8px;
    }
    .fg-base-converter-twos-complement-value {
        width: 100%;
        font-size: 13px;
        margin-bottom: 8px;
    }
    .fg-base-converter-copy-btn {
        align-self: flex-end;
        margin-left: auto;
        margin-top: -36px;
    }
} 