:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --accent: #8b5cf6;
    --background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    --surface: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border: #e5e7eb;
    --table-header: #f8fafc;
    --table-border: #e2e8f0;
    --hover: #f8fafc;
    --input-border: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #818cf8;
        --primary-dark: #6366f1;
        --danger: #f87171;
        --danger-dark: #ef4444;
        --accent: #a78bfa;
        --background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
        --surface: rgba(30, 41, 59, 0.95);
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border: #334155;
        --table-header: #1e293b;
        --table-border: #334155;
        --hover: #1e293b;
        --input-border: #475569;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px var(--shadow-color),
                0 10px 10px -5px var(--shadow-color);
}

h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 2px;
}

.home-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.home-button {
    text-decoration: none;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    display: inline-block;
}

.home-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    filter: brightness(110%);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--input-border);
    border-radius: 0.75rem;
    transition: all 0.2s;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#submitButton {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

#submitButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
    filter: brightness(110%);
}

#submitButton:active {
    transform: translateY(0);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2rem;
}

th {
    background: var(--table-header);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--table-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit {
    background: var(--primary);
    color: white;
}

.delete {
    background: var(--danger);
    color: white;
}

.actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px -1px var(--shadow-color);
    filter: brightness(110%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

tr {
    transition: background-color 0.2s;
}

tr:hover {
    background-color: var(--hover);
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    input:focus {
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    }

    #submitButton:hover {
        box-shadow: 0 4px 6px -1px rgba(129, 140, 248, 0.3);
    }

    input::placeholder {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media screen and (max-width: 640px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    input, #submitButton {
        font-size: 0.95rem;
    }
}