* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #f8fafc;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

header h1 {
    font-size: 2.5rem;
    background: -webkit-linear-gradient(45deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.right-panel {
    flex: 2.5;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h3 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.input-group {
    margin-bottom: 1.2rem;
}

.row {
    display: flex;
    gap: 0.5rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.btn:active {
    transform: translateY(2px);
}

.primary {
    background: linear-gradient(45deg, #38bdf8, #2563eb);
    color: white;
}

.primary:hover {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.secondary {
    background: #475569;
    color: white;
}

.secondary:hover {
    background: #64748b;
}

.danger {
    background: linear-gradient(45deg, #f43f5e, #e11d48);
    color: white;
}

.danger:hover {
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.stats {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
}

.logs {
    max-height: 250px;
    overflow-y: auto;
}

#logList {
    list-style: none;
}

#logList li {
    font-family: monospace;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    animation: fadeIn 0.3s ease;
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: #1e293b;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Visualization Styles */
.linked-list-container {
    display: flex;
    gap: 1rem;
    padding: 2rem 1rem;
    min-height: 120px;
    align-items: center;
    overflow-x: auto;
}

.node {
    display: flex;
    flex-direction: column;
    min-width: 90px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid #38bdf8;
    border-radius: 0.5rem;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.4s ease forwards;
}

.node.evicting {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
}

.node.accessing {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    transform: scale(1.1) translateY(-10px);
    z-index: 10;
}

.node-header {
    background: rgba(56, 189, 248, 0.2);
    padding: 0.3rem;
    font-size: 0.75rem;
    color: #38bdf8;
    font-weight: 600;
    border-top-left-radius: 0.3rem;
    border-top-right-radius: 0.3rem;
}

.node-body {
    padding: 0.8rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.connector {
    display: flex;
    align-items: center;
    color: #64748b;
    font-weight: bold;
    font-size: 1.2rem;
    animation: fadeIn 0.4s ease;
}

.hash-map-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bucket {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.bucket-header {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    text-align: center;
}

.bucket-chain {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chain-node {
    background: #1e293b;
    border-left: 3px solid #818cf8;
    padding: 0.4rem;
    font-size: 0.85rem;
    border-radius: 0.25rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
