* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #1e293b;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #fff;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sidebar-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.preset-btn {
    width: 100%;
    padding: 10px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #1e293b;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #4c4c4c;
    border-color: #0f4ba5;
}

.sidebar-input {
    width: 100%;
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.sidebar-input:focus {
    border-color: #0f4ba5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Rules Section */
.rules-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.add-btn {
    padding: 8px 16px;
    background: #0f4ba5;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #005a9e;
}

.user-agents-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* User-Agent Block */
.user-agent-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.user-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-agent-input {
    flex: 1;
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.user-agent-input:focus {
    border-color: #0f4ba5;
}

.delete-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #f93e3e;
    border-radius: 4px;
    color: #f93e3e;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #f93e3e;
    color: #fff;
}

/* Rules */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.rule-type {
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 100px;
}

.rule-type:focus {
    border-color: #0f4ba5;
}

.rule-path {
    flex: 1;
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.rule-path:focus {
    border-color: #0f4ba5;
}

.remove-rule-btn {
    padding: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s;
}

.remove-rule-btn:hover {
    color: #f93e3e;
}

.add-rule-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed #e2e8f0;
    border-radius: 4px;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.2s;
}

.add-rule-btn:hover {
    border-color: #0f4ba5;
    color: #0f4ba5;
}

/* Preview Section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.preview-header {
    padding: 10px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-tabs {
    display: flex;
    gap: 5px;
}

.preview-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.preview-tab.active {
    color: #fff;
    border-bottom-color: #0f4ba5;
}

.preview-tab:hover {
    color: #fff;
}

.copy-btn {
    padding: 6px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #4c4c4c;
}

.preview-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.preview-panel {
    display: none;
    height: 100%;
}

.preview-panel.active {
    display: block;
}

.code-preview {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Test Section */
.test-section {
    max-width: 800px;
}

.test-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.test-input {
    flex: 1;
    padding: 10px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.test-input:focus {
    border-color: #0f4ba5;
}

.test-btn {
    padding: 10px 24px;
    background: #0f4ba5;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.test-btn:hover {
    background: #005a9e;
}

.test-results {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.test-info {
    color: #64748b;
    font-size: 14px;
}

.test-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #3c3c3c;
    border-radius: 4px;
    margin-bottom: 10px;
}

.test-result-item.allowed {
    border-left: 3px solid #49cc90;
}

.test-result-item.blocked {
    border-left: 3px solid #f93e3e;
}

.test-result-icon {
    font-size: 20px;
}

.test-result-text {
    flex: 1;
}

.test-result-path {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.test-result-status {
    font-size: 12px;
    color: #64748b;
}

/* Guide Section */
.guide-content {
    max-width: 900px;
}

.guide-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 25px 0 15px 0;
}

.guide-content h3:first-child {
    margin-top: 0;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.guide-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.guide-item code {
    display: block;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #9cdcfe;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.guide-item p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.guide-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    white-space: pre-wrap;
}

/* Resize Handle */
.resize-handle {
    height: 6px;
    background: #e2e8f0;
    cursor: row-resize;
    display: flex;
    justify-content: center;
    align-items: center;
}

.resize-handle::after {
    content: '';
    width: 30px;
    height: 2px;
    background: #5a5a5a;
    border-radius: 1px;
}

.resize-handle:hover {
    background: #0f4ba5;
}

.resize-handle:hover::after {
    background: #fff;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}
