/* style.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, 'Noto Sans', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    background: #f1f5f9;
    padding: 2rem 1.5rem;
    color: #0f172a;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 28px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
}

.header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #334155;
}

.title-section h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-section h1::before {
    content: "⌨️";
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.title-section p {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-top: 6px;
}

.add-btn {
    background: #3b82f6;
    border: none;
    padding: 10px 24px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.add-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(59,130,246,0.3);
}

.add-btn:active {
    transform: translateY(1px);
}

.search-bar {
    background: #ffffff;
    padding: 0.8rem 2rem 1rem 2rem;
    border-bottom: 1px solid #eef2ff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.search-wrapper {
    flex: 3;
    min-width: 220px;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 60px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
    padding: 0 12px;
    background: white;
}

.search-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.search-icon {
    font-size: 1.1rem;
    color: #64748b;
    margin-right: 8px;
}

.search-input {
    width: 100%;
    padding: 12px 8px 12px 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    color: #0f172a;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.clear-search {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 40px;
    color: #64748b;
    transition: 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: #eef2ff;
    color: #1e293b;
}

.result-stats {
    font-size: 0.8rem;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 40px;
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
}

.table-wrapper {
    overflow-x: auto;
    padding: 0;
    background: #ffffff;
}

.command-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 680px;
}

.command-table th {
    background: #f8fafc;
    padding: 1rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.9rem;
}

.command-table td {
    padding: 1rem 1rem;
    border-bottom: 1px solid #eef2ff;
    vertical-align: middle;
    background-color: white;
}

.command-input, .comment-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: 0.2s;
    background: #fefefe;
    color: #0f172a;
}

.command-input:focus, .comment-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
    background: white;
}

.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-select {
    padding: 8px 10px;
    border-radius: 40px;
    border: 1px solid #cbd5e1;
    background: white;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.1s;
}

.action-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.confirm-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.confirm-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: scale(0.98);
}

.confirm-btn:active {
    background: #cbd5e1;
}

.empty-row td {
    text-align: center;
    padding: 3rem !important;
    color: #64748b;
    font-style: italic;
    background: #fefce8;
}

.footer-note {
    padding: 1rem 2rem;
    background: #f9fafb;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #475569;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 60px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    pointer-events: none;
    transition: 0.2s;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

@media (max-width: 700px) {
    body {
        padding: 1rem;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem 1rem 1rem 1rem;
    }
    .result-stats {
        text-align: center;
    }
    .action-cell {
        flex-direction: column;
        align-items: stretch;
    }
    .confirm-btn, .action-select {
        width: 100%;
        text-align: center;
    }
    .command-table th, .command-table td {
        padding: 0.8rem 0.6rem;
    }
}