:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --secondary-hover: #059669;
    --danger-color: #EF4444;
    --danger-hover: #DC2626;
    --bg-color: #F3F4F6;
    --panel-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.panels-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    height: calc(100vh - 280px);
    min-height: 600px;
}

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.count-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.count-badge.limit-reached {
    background: var(--danger-color);
}

textarea {
    width: 100%;
    flex-grow: 1;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    transition: var(--transition);
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Controls Panel */
.top-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
}

.control-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.btn.secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn.secondary:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4);
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: var(--text-main);
    color: white;
}

.btn.small:hover {
    background-color: black;
}

/* Exclude Panel */
.exclude-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.exclude-input-group input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.exclude-input-group input:focus {
    border-color: var(--primary-color);
}

.exclude-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.5rem;
}

.exclude-list::-webkit-scrollbar {
    width: 6px;
}

.exclude-list::-webkit-scrollbar-track {
    background: transparent;
}

.exclude-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

.exclude-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease-out;
}

.exclude-item span {
    word-break: break-all;
    font-size: 0.95rem;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-remove svg {
    width: 18px;
    height: 18px;
}

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

/* Result Message */
.result-message {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #E0F2FE;
    color: #0369A1;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    display: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.result-message.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .panels-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .top-controls {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }

    .options {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    textarea {
        min-height: 300px;
    }
    
    .exclude-list {
        min-height: 200px;
        max-height: 400px;
    }
}

.top-nav {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.top-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.top-nav a:hover, .top-nav a.active {
    color: var(--primary-color);
}

.top-nav .divider {
    color: var(--text-muted);
    margin: 0 0.5rem;
}
