:root {
    --primary: #7aa2f7;
    --secondary: #9ece6a;
    --dark-primary: #0f1724;
    --dark-secondary: #1abc9c;
    --error: #cf6679;
}

* {
    font-family: "ubuntu condensed", sans-serif;
    font-weight: 400;
    box-sizing: border-box;
}

body {
    background-color: #0b1220;
    color: #a6accd;
    margin: 0;
    padding: 0;
}

header,
nav {
    background-color: #151922;
    border-bottom: 2px solid #232634;
}

header {
    padding: 1.25rem;
    text-align: center;
}

h1 a,
h2 {
    color: var(--primary);
}

h1 a {
    text-decoration: none;
    font-size: 2.5em;
    font-weight: bold;
}

h2 {
    text-align: center;
    font-size: 2em;
}

nav {
    padding: 0.625rem 1.25rem;
    text-align: center;
}

nav a {
    color: var(--secondary);

    text-decoration: none;
    font-weight: bold;
    font-size: 1.3em;
    margin: 0 0.9375rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: #202436;
}

main {
    padding: 1.25rem;
    max-width: 50rem;
    margin: 0 auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #151922;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
}

th,
td {
    padding: 0.75rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid #232634;
}

th {
    background-color: #232634;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
}

.date {
    width: 15%;
}

tr:nth-child(even) {
    background-color: #252525;
}

tr:hover {
    background-color: #383838;
}

td a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: bold;
}

td a:hover {
    text-decoration: underline;
}

form {
    background-color: #151922;
    padding: 1.5625rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

form div {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"] {
    background-color: #252525;
    border: 1px solid #232634;
    color: #a6accd;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: 1em;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #7aa2f7;
}

input[type="submit"] {
    background-color: var(--secondary);
    color: #0b1220;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #018786;
}

.error {
    color: var(--error);
}

.long {
    word-break: break-word;
}

/* Pagination Styles */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #151922;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
}

.pagination-info {
    color: #a6accd;
    font-weight: bold;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-pagination {
    background-color: var(--secondary);
    color: #0b1220;
}

.btn-pagination:hover {
    background-color: #018786;
}

.btn-pagination.disabled {
    background-color: #444;
    color: #666;
    cursor: not-allowed;
}

.btn-pagination.disabled:hover {
    background-color: #444;
}

.delete {
    form {
        display: inline;
        background: none;
        box-shadow: unset;
        background-color: none;

        button {
            background: none;
            border: none;
            color: var(--error);
            cursor: pointer;
        }
    }
}

@media screen and (max-width: 50rem) {
    header {
        font-size: 0.5rem;
    }

    main {
        max-width: 90%;
        padding: 0;
    }

    main h2 {
        margin: 1rem 0;
        font-size: 1.6em;
    }

    form {
        margin-top: 1.25rem;
    }

    table,
    tbody,
    th,
    td,
    tr {
        display: block;
        font-size: 1em;
    }

    tr {
        margin: 0 0 1rem 0;
        border: 1px solid #232634;
        border-radius: 0.5rem;
        cursor: pointer;
    }

    td {
        border: none;
        border-bottom: 1px solid #444;
        position: relative;
        padding-left: 6rem;
        word-wrap: break-word;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        padding-left: 0.9375rem;
        font-weight: bold;
        color: var(--primary);
    }

    td:nth-of-type(1):before {
        content: "Short";
    }

    td:nth-of-type(2):before {
        content: "Long";
    }

    td:nth-of-type(3):before {
        content: "Created";
    }

    .date {
        width: 100%;
    }
}

@media (prefers-color-scheme: light) {
    body {
        background-color: #eceff4;
        color: #2e3440;
    }

    header,
    nav {
        background-color: #f2f6fa;
        border-bottom: 2px solid #e1e6eb;
    }

    h1 a,
    h2 {
        color: #6b7280;
    }

    nav a {
        color: #64748b;
    }

    nav a:hover {
        background-color: #eef4fb;
    }

    table {
        background-color: #ffffff;
        box-shadow: 0 0.25rem 0.5rem rgba(46, 52, 64, 0.06);
    }

    th {
        background-color: #e8eff6;
        color: #2e3440;
    }

    tr:nth-child(even) {
        background-color: #f6f9fc;
    }

    tr:hover {
        background-color: #eef4f9;
    }

    td a {
        color: #475569;
    }

    td a:hover {
        text-decoration: underline;
    }

    form {
        background-color: #ffffff;
        box-shadow: 0 0.25rem 0.5rem rgba(46, 52, 64, 0.06);
    }

    input[type="text"],
    input[type="password"] {
        background-color: #ffffff;
        border: 1px solid #e1e6eb;
        color: #2e3440;
    }

    input[type="text"]:focus,
    input[type="password"]:focus {
        border-color: #0f1724;
    }

    input[type="submit"] {
        background-color: #e6eef7;
        color: #475569;
        border: 1px solid #d0d8e3;
    }

    input[type="submit"]:hover {
        background-color: #dfeaf5;
    }

    .error {
        color: #bf616a;
    }

    td:before {
        color: #94a3b8;
    }

    /* Light mode pagination styles */
    .pagination {
        background-color: #ffffff;
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    }

    .pagination-info {
        color: #121212;
    }

    .btn-pagination {
        background-color: #e6eef7;
        color: #475569;
        border: 1px solid #d0d8e3;
    }

    .btn-pagination:hover {
        background-color: #dfeaf5;
    }

    .btn-pagination.disabled {
        background-color: #f5f5f5;
        color: #999;
        border: 1px solid #ddd;
    }

    .btn-pagination.disabled:hover {
        background-color: #f5f5f5;
    }
}

@media screen and (max-width: 50rem) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .pagination-buttons {
        justify-content: center;
    }
}
