/* General Styles */
:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --accent: #00ff88;
    --bg-dark: #030712;
    --sidebar-bg: #0b1120;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(0, 210, 255, 0.08);
    color: var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(0, 210, 255, 0.2);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px var(--primary-color));
}

.sidebar-footer {
    font-size: 0.75rem;
    color: #404060;
    line-height: 1.6;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: rgba(3, 7, 18, 0.5);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    margin: -40px -40px 40px -40px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 900;
}

.search-bar {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 350px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification {
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.profile-img {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
}

/* Section Styling */
.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-actions p {
    margin: 0;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

/* Panels */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
}

.input-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.input-group input, .input-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.1);
}

.recommendations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rec-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.rec-tag:hover, .rec-tag.selected {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-accent {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    flex: 2;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.output-panel {
    display: flex;
    flex-direction: column;
}

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

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

.output-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 25px;
    height: 100%;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #e0e0f0;
    white-space: pre-wrap;
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #404060;
    gap: 15px;
}

.empty-state i {
    font-size: 3rem;
}

/* Knowledge Grid */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.k-card h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.k-card ul {
    list-style: none;
}

.k-card ul[contenteditable="true"] {
    outline: none;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s;
    min-height: 100px;
    margin-top: 10px;
}

.k-card ul[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(0, 210, 255, 0.3);
}
.automation-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 242, 255, 0.05);
    border-radius: 12px;
    border: 1px dashed var(--primary-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.automation-info i {
    color: var(--primary-color);
    margin-right: 5px;
}

.loading-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.loading-step {
    font-size: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-step i.fa-check-circle {
    color: #00ff88;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    animation: progress 2s ease-in-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.final-result {
    animation: fadeIn 0.5s ease-out;
}

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

.k-card li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: var(--text-muted);
}

.k-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
.history-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin-top: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    gap: 15px;
    flex-wrap: wrap;
}

.history-controls .control-group {
    flex: 1;
}

#open-excel-btn {
    text-decoration: none;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    cursor: pointer;
    transition: var(--transition);
}

.history-item .h-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.history-item.exported {
    border-color: rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.02);
}

.history-item.exported .h-keyword {
    color: var(--text-muted);
}

.h-status-icon {
    color: #00ff88;
    font-size: 1.1rem;
    margin-right: 15px;
    display: none;
}

.exported .h-status-icon {
    display: block;
}

.h-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.h-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.h-keyword {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.history-item i {
    color: var(--text-muted);
    transition: var(--transition);
}

.history-item:hover i {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Premium Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom up */
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(18, 25, 45, 0.85);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 340px;
    max-width: 450px;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: toastInModern 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.toast i {
    font-size: 1.2rem;
}

.toast.success { border-bottom: 3px solid #00ff88; }
.toast.info { border-bottom: 3px solid #00d2ff; }
.toast.error { border-bottom: 3px solid #ff4d4d; }

@keyframes toastInModern {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastOutModern {
    from { transform: translateY(0) scale(1); opacity: 1; }
    to { transform: translateY(10px) scale(0.9); opacity: 0; }
}
/* Settings Section Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.settings-card h3 {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.status-badge {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge.valid {
    background: rgba(0, 255, 136, 0.05);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}
