/* Fonts - Montserrat Alternates, Marmelad, Roboto */
@import url('https://fonts.googleapis.com/css2?family=Marmelad&family=Montserrat+Alternates:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Montserrat Alternates", "Marmelad", "Roboto";
}

:root {
    --color-text: #191919;
    --color-text-alt: #555555;
    --color-bg: #F1F5F9;
    --color-bg-alt: #FCFBFF;
    --color-sidebar-border: #E2E8F0;
    --color-accent: #5096E6;
    --color-accent-alt: #4b8eda;
    --color-hover: #F7FBFF;
    --color-shadow: rgb(0, 0, 0, 0.05);
}

@media (max-width: 700px) {
  .sidebar {
    display: none !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
  }

  .main-content {
    margin-left: 28px !important;
  }
}

body {
    background: var(--color-bg);
}

.container {
    display: flex;
    align-items: left;
    justify-content: flex-start;
}

.sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 300px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--color-bg-alt);
    border-right: 1px solid var(--color-sidebar-border);
    border-radius: 0 16px 16px 0;
    box-shadow: 0 3px 9px var(--color-shadow);
}

.sidebar__header {
    display: flex;
    padding: 20px 18px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-sidebar-border);
}

.sidebar__header__logo {
    width: fit-content;
    height: 48px;
    object-fit: cover;
    display: block;
}

.sidebar__navigation {
    flex: 1;
    padding: 20px 18px;
}

.navigation__menu {
    display: flex;
    margin: 20px 0px 20px 0px;
    gap: 4px;
    flex-direction: column;
    list-style: none;
}

.menu-item__link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    padding: 14px 20px;
    border-radius: 8px;
    color: var(--color-text);
    transition: 0.2s ease;
}

.menu-item__link:is(:hover, .active) {
    color: #fff;
    background: var(--color-accent);
}

.menu-item__label {
    font-weight: 500;
}

.sidebar__extra {
    flex: 0;
    padding: 0 18px;
}

.extra__menu {
    display: flex;
    margin: 20px 0px 20px 0px;
    gap: 4px;
    flex-direction: column;
    list-style: none;
}

.sidebar__footer {
    padding: 20px 18px;
    border-top: 1px solid var(--color-sidebar-border);
    font-weight: 400;
}

.main-content {
    height: 100vh;
    width: 100vw;
    margin-left: 328px;
    margin-right: 32px;
}

.header {
    display: flex;
    padding: 20px 0;
    align-items: center;
    justify-content: space-between;
}

.search-form {
    min-height: 48px;
    border-radius: 8px;
    display: flex;
    padding: 0 15px;
    margin: 5px 0 20px;
    align-items: center;
    white-space: nowrap;
    background: var(--color-bg-alt);
    transition: 0.3 ease;
}

.search-form:focus-within {
    background: var(--color-hover);
}

.search-form__input {
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    width: 100%;
    margin-left: 15px;
    color: var(--color-text);
}

.header__right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header__change-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header__button {
    text-decoration: none;
    color: var(--color-text);
}

.header__account-logo {
    width: 44px;
    height: 44px;
    display: block;
    text-decoration: none;
    object-fit: cover;
    border-radius: 50%;
}

.characters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.characters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.characters__label {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: left;
    color: var(--color-text);
    margin: 0;
    align-self: center;
    display: block;
}

.characters__add-characters {
    min-height: 32px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 12px 16px 12px 12px;
    border-radius: 8px;
    color: var(--color-bg);
    background: var(--color-accent);
}

.characters__add-characters:hover {
    background: var(--color-accent-alt);
}

.add-characters__label {
    font-weight: 500;
}

.characters__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: minmax(250px, auto);
    gap: 20px;
}

.card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--color-bg-alt);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--color-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px var(--color-shadow);
}

.card__cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card__title {
    margin: 12px;
    font-size: 1.2rem;
}

.card__text {
    margin: 0 12px 16px;
    font-size: 0.95rem;
    color: var(--color-text-alt);
}

.card__snippet {
    margin: 0 12px 16px;
    font-size: 0.95rem;
    color: var(--color-text-alt);
}

.table {
    margin: 0px auto 24px auto;
    overflow: auto;
}

.table__joke-title {
    font-size: 28px;
    font-weight: bold;
    text-align: left;
    color: var(--color-text);
    align-self: center;
    display: block;
    margin-bottom: 24px;
}

.table__grid {
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--color-shadow);
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
}

thead th {
    padding: 0.75rem;
    background: var(--color-bg);
    color: var(--color-text); 
    font-weight: 600;
    text-align: left;
}

td {
    padding: 0.75rem;
    color: var(--color-text-alt);
    border-bottom: 1px solid #e1e7f0;
    border-right: 1px solid #e1e7f0;
    box-sizing: border-box;
    word-break: break-word;
}

thead, tbody, tr { display: contents; }
tbody tr:nth-child(odd) td { background: var(--color-bg-alt); }
tbody tr:nth-child(even) td { background: var(--color-hover); }
