:root {
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --border: #e3e8f2;
    --text-main: #1c2333;
    --text-muted: #5f6b85;
    --primary: #0d47fb;
    --primary-dark: #0a2fa3;
    --accent: #8b5cf6;
    --success: #22c55e;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 8px 24px rgba(13, 71, 251, 0.15);
    --gradient: linear-gradient(135deg, #0d47fb 0%, #8b5cf6 100%);
}

/* Panel and Card Styles */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 32px;
    height: 100%;
    transition: background 0.3s ease, border 0.3s ease;
}

.tool-card {
    margin-bottom: 40px;
}

.tool-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
}

.column-left,
.column-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.column-header {
    margin-bottom: 24px;
}

.column-header h2 {
    color: var(--text-main);
    font-weight: 600;
}

.column-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.column-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
    margin: 0;
}

.tool-wrapper {
    margin-bottom: 40px;
}

/* BBCode Tags Quick Insert */
.bbcode-tags-wrapper {
    margin-bottom: 20px;
}

.tags-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bbcode-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bbcode-tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbcode-tag-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.2);
}

.bbcode-tag-btn:active {
    transform: translateY(0);
}

.bbcode-tag-btn i {
    font-size: 12px;
}

/* Editor Styles */
.editor-wrapper {
    position: relative;
    margin-top: 20px;
}

.editor-wrapper label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: var(--text-muted);
    font-size: 14px;
}

.code-editor {
    width: 100%;
    padding: 16px;
    
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    resize: vertical;
    transition: all 0.2s ease;
}

.code-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 251, 0.1);
    background: var(--surface);
}

.code-editor:read-only {
    background: var(--surface-muted);
    cursor: default;
}

.code-editor::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-action-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-modern:hover {
    background: var(--surface-muted);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

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

.btn-action-modern i {
    font-size: 13px;
}

/* Conversion Options */
.conversion-options {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-muted);
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.options-header:hover {
    background: rgba(13, 71, 251, 0.05);
}

.options-header h3 {
    color: var(--text-main);
    font-weight: 600;
    margin: 0;
}

.options-header i {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.options-header.active i {
    transform: rotate(180deg);
}

.options-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.options-content.active {
    max-height: 500px;
    padding: 20px;
}

.options-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 8px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.2);
}

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

.copy-btn i {
    font-size: 12px;
}

/* Stats Container */
.stats-container {
    margin-top: 16px;
    padding: 16px;
    background: var(--surface-muted);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* BBCode Tags Section */
.bbcode-tags-section {
    margin-top: 40px;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tag-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.tag-card:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.1);
}

.tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.tag-icon i {
    font-size: 16px;
}

.tag-content {
    flex: 1;
    min-width: 0;
}

.tag-content strong {
    display: block;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 4px;
    
}

.tag-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Preview Modal */
.preview-content {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .tool-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .column-divider {
        display: none;
    }

    .column-left,
    .column-right {
        margin-bottom: 24px;
    }

    .column-right {
        margin-bottom: 0;
    }

    .panel {
        padding: 24px;
    }

    .tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 767px) {
    .panel {
        padding: 20px;
        border-radius: 16px;
    }

    .code-editor {
        font-size: 13px;
        padding: 12px;
    }

    .bbcode-tags {
        gap: 6px;
    }

    .bbcode-tag-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action-modern {
        width: 100%;
        justify-content: center;
    }

    .output-actions {
        flex-wrap: wrap;
    }

    .copy-btn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
    }

    .tags-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .bbcode-tag-btn span {
        display: none;
    }

    .bbcode-tag-btn {
        padding: 8px;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .bbcode-tag-btn i {
        margin: 0;
    }
}

