/**
 * Minecraft Banner Maker Styles
 */

:root {
    --minecraft-green: #44bd32;
    --minecraft-dark-green: #3aa831;
    --minecraft-panel: #1D1C1A;
    --minecraft-panel-light: #2c2b29;
    --minecraft-text: #E0E0E0;
}

/* 工具容器 */
.tool-container {
    background-color: var(--minecraft-panel);
    border: 2px solid var(--minecraft-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 20px;
}

/* 表单容器 */
.banner-form-container {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Banner创建器布局 */
.banner-creator {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    width: 100%;
}

/* Banner预览区域 */
.banner-preview-container {
    background-color: var(--minecraft-panel-light);
    padding: 20px;
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.banner-preview-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--minecraft-green);
    text-align: center;
    font-family: 'VT323', monospace;
}

.banner-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

#banner-canvas-container {
    position: relative;
    width: 468px;
    height: 60px;
    max-width: 100%;
    background-color: #000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

#banner-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

#loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--minecraft-green);
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.banner-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.frame-info {
    text-align: center;
    font-family: 'VT323', monospace;
    color: #AAAAAA;
}

/* Banner编辑区域 */
.banner-editor {
    background-color: var(--minecraft-panel-light);
    padding: 20px;
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    height: 100%;
}

.banner-editor h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--minecraft-green);
    font-family: 'VT323', monospace;
}

.settings-group {
    margin-bottom: 15px;
}

.settings-group label {
    display: block;
    margin-bottom: 5px;
    color: #CCCCCC;
    font-weight: 500;
}

.settings-group select, 
.settings-group input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    appearance: none;
}

.settings-group select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6"><path d="M0,0 L12,0 L6,6 Z" fill="%23FFFFFF"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* 背景选择器 */
.background-selector {
    display: flex;
    gap: 10px;
}

.background-selector select {
    flex: 1;
}

.bg-preview {
    width: 60px;
    height: 40px;
    background-color: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    background-size: cover;
    background-position: center;
}

/* 文本效果选项 */
.effects-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.effect-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.effect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 帧文本区域 */
.text-frames-container {
    background-color: var(--minecraft-panel-light);
    padding: 20px;
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    height: 100%;
}

.frames-help {
    margin: 5px 0 15px;
    color: #AAAAAA;
    font-size: 0.9rem;
}

.text-frames {
    display: grid;
    gap: 15px;
    max-width: 100%;
}

.text-frame {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.3s ease;
}

.text-frame.active {
    border-color: var(--minecraft-green);
    box-shadow: 0 0 8px rgba(68, 189, 50, 0.3);
}

.frame-header {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    font-family: 'VT323', monospace;
    color: #AAAAAA;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-frame.active .frame-header {
    background-color: rgba(68, 189, 50, 0.2);
    color: var(--minecraft-green);
}

.frame-title {
    font-weight: bold;
}

.frame-settings-toggle {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #AAAAAA;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.frame-settings-toggle:hover {
    background-color: rgba(68, 189, 50, 0.2);
    color: var(--minecraft-green);
}

.text-frame.active .frame-settings-toggle {
    background-color: rgba(68, 189, 50, 0.3);
    color: var(--minecraft-green);
}

.frame-text {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    border: none;
    color: white;
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
}

.frame-text:focus {
    outline: none;
}

/* 帧设置区域 */
.frame-settings {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
    gap: 10px;
}

.text-frame.show-settings .frame-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* 在小屏幕上改为单列 */
@media (max-width: 480px) {
    .text-frame.show-settings .frame-settings {
        grid-template-columns: 1fr;
    }
}

.frame-setting {
    margin-bottom: 8px;
}

.frame-setting label {
    display: block;
    margin-bottom: 4px;
    color: #AAAAAA;
    font-size: 0.9rem;
}

.frame-setting select,
.frame-setting input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    appearance: none;
    font-size: 0.9rem;
}

.frame-setting select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6"><path d="M0,0 L12,0 L6,6 Z" fill="%23FFFFFF"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.frame-effects {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.frame-effects .effect-option {
    font-size: 0.9rem;
}

/* Banner操作按钮 */
.banner-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 动画速度设置 */
#animation-speed {
    width: 100%;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    appearance: none;
}

/* 结果区域 */
.banner-result {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.banner-result.hidden {
    display: none;
}

.banner-result h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--minecraft-green);
    font-family: 'VT323', monospace;
    text-align: center;
}

.result-preview {
    margin-bottom: 20px;
    position: relative;
}

.result-preview img {
    max-width: 100%;
    border: 2px solid rgba(68, 189, 50, 0.3);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated; /* 像素风格渲染 */
}

/* 成功消息样式 */
.success-message {
    background-color: rgba(68, 189, 50, 0.2);
    color: var(--minecraft-green);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--minecraft-green);
    border-radius: 4px;
    font-weight: bold;
    animation: fade-in-out 3s forwards;
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.result-code {
    text-align: left;
    margin-top: 20px;
}

.result-code.hidden {
    display: none;
}

.result-code h4 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* 代码选项卡 */
.code-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--minecraft-secondary);
}

.code-tab {
    background: none;
    border: none;
    padding: 8px 15px;
    margin-right: 5px;
    cursor: pointer;
    color: var(--minecraft-text);
    opacity: 0.7;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
}

.code-tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 0.9;
}

.code-tab.active {
    background-color: var(--minecraft-secondary);
    color: white;
    opacity: 1;
    position: relative;
}

.code-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--minecraft-green);
}

.code-container {
    position: relative;
    margin-bottom: 15px;
}

.code-container textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #DDDDDD;
    font-family: monospace;
    resize: none;
}

.code-container button {
    align-self: flex-end;
}

/* 使用指南 */
.usage-guide {
    background-color: var(--minecraft-panel-light);
    padding: 20px;
    border-radius: 6px;
}

.usage-guide h2 {
    color: var(--minecraft-green);
    margin-top: 0;
    margin-bottom: 15px;
    font-family: 'VT323', monospace;
    text-align: center;
    font-size: 1.6rem;
}

.usage-guide p {
    margin-bottom: 20px;
    text-align: center;
    color: #CCCCCC;
}

.guide-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .guide-sections {
        grid-template-columns: 1fr 1fr;
    }
}

.guide-section h3 {
    color: var(--minecraft-green);
    margin-bottom: 12px;
    font-family: 'VT323', monospace;
}

.guide-section ol,
.guide-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.guide-section li {
    margin-bottom: 8px;
    color: #BBBBBB;
}

/* 提示框样式 */
.minecraft-note {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--minecraft-green);
    padding: 15px;
    margin-top: 20px;
}

.minecraft-note h4 {
    color: var(--minecraft-green);
    margin-top: 0;
    margin-bottom: 8px;
    font-family: 'VT323', monospace;
}

.minecraft-note p {
    margin: 0;
    font-size: 0.95rem;
    text-align: left;
    color: #BBBBBB;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .banner-creator {
        grid-template-columns: 1fr; /* 在小屏幕上变为单列布局 */
    }
    
    .banner-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .banner-preview {
        margin-bottom: 10px;
    }
    
    .banner-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .frame-info {
        width: 100%;
        order: -1;
        margin-bottom: 10px;
    }
    
    .background-selector {
        flex-direction: column;
    }
    
    .bg-preview {
        width: 100%;
        height: 40px;
    }
}

/* 结果信息 */
.result-info {
    margin-top: 10px;
    text-align: center;
}

.animation-note {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 4px;
    color: #BBBBBB;
    font-size: 0.9rem;
}

.animated-label {
    background-color: var(--minecraft-green);
    color: #000;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    animation: pulse 2s infinite;
    font-size: 0.8rem;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Banner设置和动画帧列 */
.banner-settings-column,
.banner-frames-column {
    width: 100%;
}

/* Banner设置列占较少空间 */
.banner-settings-column {
    min-width: 250px;
}

/* 动画帧列占更多空间 */
.banner-frames-column {
    min-width: 300px;
} 

/* 新增特效样式 */
.frame-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.effect-option {
    margin-bottom: 5px;
}

@media (max-width: 480px) {
    .frame-effects {
        flex-direction: column;
    }
}

/* 发光效果预览 */
.text-glow-preview {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 描边效果预览 */
.text-outline-preview {
    -webkit-text-stroke: 1px #000;
    text-stroke: 1px #000;
}

/* 禁用效果选项 */
.effect-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.effect-option.disabled input {
    cursor: not-allowed;
}

/* 自定义背景上传相关样式 */
#custom-bg-upload {
    margin-top: 10px;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-input {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px;
    color: #CCCCCC;
}

.upload-info {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
}

.upload-info p {
    margin: 3px 0;
    color: #AAAAAA;
    font-size: 0.85rem;
}

.upload-preview {
    width: 100%;
    height: 60px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 8px;
}

.upload-error {
    color: #FF5555;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.upload-success {
    color: var(--minecraft-green);
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
} 