:root {
    color-scheme: dark;
    --primary-bg: #303136;
    --secondary-bg: #3a3c41;
    --panel-bg: #3a3c41;
    --panel-raised: #47494f;
    --panel-hover: #53565d;
    --input-bg: #4b4e55;
    --input-hover-bg: #50535a;
    --input-focus-bg: #555860;
    --input-readonly-bg: #44474d;
    --border-color: #676b73;
    --text-color: #f2f2f2;
    --muted-text: #c0c4ca;
    --accent-color: #86bdff;
    --accent-strong: #4a86f3;
    --accent-soft: rgba(134, 189, 255, 0.15);
    --success-color: #6fca8c;
    --warning-color: #e6b450;
    --danger-color: #e06c75;
    --btn-bg: #4a86f3;
    --btn-hover: #6095f5;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --focus-ring: rgba(134, 189, 255, 0.36);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at 12% -8%, rgba(53, 116, 240, 0.13), transparent 34rem),
        radial-gradient(circle at 92% 16%, rgba(111, 202, 140, 0.07), transparent 28rem),
        var(--primary-bg);
    color: var(--text-color);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

#layoutContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#header {
    position: relative;
    z-index: 1020;
    width: 100%;
}

#layoutNotificationBanner,
#layoutContent,
#footer {
    position: relative;
    z-index: auto;
}

#home,
#layoutContent {
    flex: 1;
}

a {
    color: var(--accent-color);
    text-underline-offset: 3px;
    transition: color 0.16s ease;
}

a:hover {
    color: #b2d4ff;
}

::selection {
    color: #ffffff;
    background: rgba(53, 116, 240, 0.72);
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: #292b2f;
}

::-webkit-scrollbar-thumb {
    background: #62666d;
    border: 3px solid #292b2f;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5c6068;
}

.footer {
    text-align: center;
    padding: 18px 24px;
    background: rgba(48, 49, 54, 0.92);
    border-top: 1px solid #3c3f44;
    font-size: 13px;
    color: var(--muted-text);
    width: 100%;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
}

.footer a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(134, 189, 255, 0.62);
    text-decoration-thickness: 1px;
}

.footer a:hover {
    color: #b2d4ff;
    text-decoration-color: currentColor;
}

.navbar {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 64px;
    padding: 10px clamp(18px, 4vw, 52px);
    overflow: visible;
    background: rgba(48, 49, 54, 0.96);
    border-bottom: 1px solid #555960;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 0;
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
}

.navbar nav a {
    color: #d4d7dc;
    text-decoration: none;
    margin: 0 4px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.navbar nav a:hover {
    color: #ffffff;
    background: var(--panel-hover);
    border-color: rgba(255, 255, 255, 0.06);
}

.hero {
    text-align: center;
    padding: clamp(42px, 8vw, 76px) 20px 36px;
}

.hero h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 750;
    letter-spacing: -0.035em;
    text-shadow: 0 10px 32px rgba(0, 0, 0, 0.42);
}

.hero p {
    max-width: 680px;
    margin: 0 auto;
    font-size: 17px;
    color: var(--muted-text);
}

.btn {
    background-color: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 650;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-success,
.btn-success:hover {
    background-color: #367d4d !important;
    border-color: #4f9664 !important;
}

.btn-danger {
    background-color: #b64b55 !important;
    border-color: #cf626c !important;
}

.btn-primary {
    background-color: var(--btn-bg) !important;
    border-color: #5c8ff4 !important;
}

.btn-info {
    color: #ffffff !important;
    background-color: #436f8f !important;
    border-color: #5d8eaf !important;
}

.btn-outline-primary {
    color: var(--accent-color) !important;
    border-color: #5c8ff4 !important;
}

.btn-outline-primary:hover {
    color: #ffffff !important;
    background: var(--accent-strong) !important;
}

.btn:hover {
    color: #ffffff;
    background-color: var(--btn-hover);
    border-color: #7e9ff5;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.27);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
    padding: 32px 24px 64px;
}

.feature {
    position: relative;
    flex: 1 1 280px;
    overflow: hidden;
    background: linear-gradient(145deg, #45474c, var(--panel-bg));
    padding: 30px;
    border: 1px solid #42454b;
    border-radius: var(--radius-lg);
    width: min(100%, 380px);
    box-shadow: 0 14px 34px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-color), var(--success-color));
    opacity: 0.72;
}

.feature:hover {
    border-color: #596474;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(134, 189, 255, 0.09);
    transform: translateY(-3px);
}

.feature h2,
.feature h3 {
    letter-spacing: -0.02em;
}

.bg-dark {
    background-color: var(--panel-bg) !important;
}

.bg-secondary {
    background-color: var(--panel-raised) !important;
}

.shadow,
.shadow-sm,
.shadow-lg {
    box-shadow: 0 14px 34px var(--shadow-color) !important;
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    color: var(--text-color);
    background-color: var(--input-bg);
    border-color: var(--border-color);
}

.form-control,
.form-select {
    min-height: 42px;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control:hover,
.form-select:hover {
    background-color: var(--input-hover-bg);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-focus-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-control::placeholder {
    color: #adb2ba;
    opacity: 1;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    color: #c3c6ca;
    background-color: var(--input-readonly-bg);
}

.form-control-plaintext {
    color: var(--text-color);
}

.table {
    --bs-table-color: #dfe1e5;
    --bs-table-bg: transparent;
    --bs-table-border-color: #45484e;
    --bs-table-striped-color: #e7e9ec;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: var(--accent-soft);
    color: #dfe1e5;
    border-color: #45484e;
}

.table thead th {
    color: #b9d7ff;
    background: #37393e;
    border-bottom-color: #59606a;
    font-size: 12px;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.table > :not(caption) > * > * {
    padding: 0.65rem 0.7rem;
    background-color: transparent;
}

.alert {
    color: var(--text-color);
    background: var(--panel-raised);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--accent-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.pagination .page-link {
    color: #cbd0d6;
    background: var(--panel-bg);
    border-color: var(--border-color);
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    color: #ffffff;
    background: var(--accent-strong);
    border-color: #5c8ff4;
}

.pagination .page-item.disabled .page-link {
    color: #70757c;
    background: #34363b;
    border-color: #555960;
}

.progress {
    height: 10px;
    background: #34363b;
    border: 1px solid #45484d;
    border-radius: 999px;
}

hr {
    border-color: var(--border-color);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .features {
        flex-direction: column;
        align-items: center;
    }

    .feature {
        width: 100%;
        margin-bottom: 0;
    }
}

.log-form {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 6px;
}

.log-form a[href="/userprofile"] {
    color: var(--accent-color);
    font-weight: 700;
    padding: 6px 10px;
    border: 1px solid rgba(134, 189, 255, 0.36);
    border-radius: 999px;
    background: rgba(134, 189, 255, 0.1);
}

.log-form a[href="/userprofile"]:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
}

.log-form .btn {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 8px;
}

/* Kinorat styles */
.certified_fresh {
    background: url('../images/certified_fresh.png') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.certifiedfresh {
    background: url('../images/certified_fresh.png') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.fresh {
    background: url('../images/fresh.png') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.rotten {
    background: url('../images/rotten.png') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.green_popcorn {
    background: url('../images/green_popcorn.svg') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.red_popcorn {
    background: url('../images/green_popcorn.svg') no-repeat;
    background-size: cover;
    height: 20px;
    width: 20px;
    vertical-align: text-bottom;
}

.movie-icon {
    background: url('../images/movie-icon.png') no-repeat;
    background-size: cover;
    height: 40px;
    width: 40px;
    vertical-align: text-bottom;
    cursor: pointer;
}

.kinorat-watch-online-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 6px 12px;
    text-decoration: none;
    font-weight: bold;
    width: fit-content;
}

.kinorat-watch-online-link:hover {
    color: var(--text-color);
    background-color: var(--btn-hover);
    text-decoration: none;
}

.kinorat-watch-online-link .movie-icon {
    height: 20px;
    width: 20px;
    margin: 0;
}


.logo-picture {
    background: url('../images/logo.png') no-repeat;
    background-size: cover;
    height: 40px;
    width: 40px;
    vertical-align: text-bottom;
    cursor: pointer;
    margin-top: 5px;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.header-brand:hover {
    color: var(--text-color);
    opacity: 0.9;
    transform: translateY(-1px);
}

.header-brand-logo {
    display: inline-block;
    width: 38px;
    height: 38px;
    background: url('../images/logo.png') no-repeat center;
    background-size: contain;
}

.header-brand-text {
    font-size: 22px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    text-shadow: 0 0 18px rgba(134, 189, 255, 0.3);
}

.header-mobile-user {
  display: none;
  margin-right: 5px;
  margin-left: auto;
  color: var(--accent-color);
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid rgba(134, 189, 255, 0.36);
  border-radius: 999px;
  background: rgba(134, 189, 255, 0.1);
  text-decoration: none;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.header-mobile-user span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-menu-toggle {
    display: none;
}

.header-menu-button {
    display: none;
    width: 42px;
    height: 38px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(134, 189, 255, 0.5);
    border-radius: var(--radius-sm);
    background: #34363b;
    cursor: pointer;
}

.header-menu-button span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.header-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
}

.header-menu-toggle:checked + .header-menu-button span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.header-menu-toggle:checked + .header-menu-button span:nth-child(2) {
    opacity: 0;
}

.header-menu-toggle:checked + .header-menu-button span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.kinorat-mouse-loader {
    position: relative;
    width: 320px;
    max-width: 100%;
    height: 56px;
    margin: 0 auto;
    overflow: hidden;
}

.kinorat-mouse-loader::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    border-bottom: 2px dashed var(--accent-color);
    opacity: 0.55;
}

.kinorat-mouse-loader-logo {
    position: absolute;
    left: 0;
    bottom: 12px;
    width: 42px;
    height: 42px;
    background: url('../images/logo.png') no-repeat center;
    background-size: contain;
    animation: kinorat-mouse-run 1.25s linear infinite;
}

@keyframes kinorat-mouse-run {
    0% {
        transform: translateX(-46px) rotate(-4deg);
    }

    50% {
        transform: translateX(162px) rotate(4deg);
    }

    100% {
        transform: translateX(326px) rotate(-4deg);
    }
}

.kinorat-not-found-star-wars {
    height: 220px;
    overflow: hidden;
    perspective: 280px;
    color: #ffc107;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}

.kinorat-not-found-crawl {
    width: 80%;
    margin: 0 auto;
    transform: rotateX(24deg);
    animation: kinorat-not-found-crawl 10s linear infinite;
}

.kinorat-not-found-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.kinorat-not-found-subtitle {
    font-size: 28px;
    margin-bottom: 18px;
}

.kinorat-not-found-crawl p {
    font-size: 20px;
    margin-bottom: 10px;
}

@keyframes kinorat-not-found-crawl {
    0% {
        transform: rotateX(24deg) translateY(190px);
    }

    100% {
        transform: rotateX(24deg) translateY(-260px);
    }
}


.imdb-logo {
    background: url('../images/imdb_logo.png') no-repeat;
    background-size: cover;
    height: 45px;
    width: 100px;
    vertical-align: middle;
}

.metacritic-logo {
    background: url('../images/metacritic_logo.png') no-repeat;
    background-size: cover;
    height: 35px;
    width: 150px;
    vertical-align: text-bottom;
}

.rotten-tomatoes-logo {
    background: url('../images/rotten_tometoes_logo.png') no-repeat;
    background-size: cover;
    height: 40px;
    width: 130px;
    vertical-align: text-bottom;
}

.rotten-tomatoes-logo2 {
    background-image: url('../images/rotten_tometoes_logo.png');
    background-size: contain;
    height: 40px;
    width: 130px;
    vertical-align: text-bottom;
}

.enjoy-movie-search {
    color: var(--text-color);
}

.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
    color: #ffffff;
    background-color: var(--panel-raised);
    border-color: var(--accent-color) var(--border-color) var(--panel-raised);
    box-shadow: inset 0 2px 0 var(--accent-color);
}

.nav-rotten-tomatoes {
    background: red;
    padding-left: 1em;
    padding-right: 1em;
    border-radius: 15px;
}

.collapse-group {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: rgba(43, 45, 48, 0.76);
}

/* Center align text inside tabs */
.nav-tabs .nav-link {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    text-align: center;
    height: 64px;
    width: 100%;
    color: var(--muted-text);
    background: #36383d;
    border-color: #3f4248;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.nav-tabs .nav-link:hover {
    color: #ffffff;
    background: #45474c;
    border-color: #52565d;
}

/* Adjust tab container to be well aligned */
.nav-tabs {
    overflow: hidden;
    border: 1px solid #41444a;
    border-radius: var(--radius-md);
    background: #36383d;
    justify-content: center;
}

/* Move content lower */
#movieSearchContent {
    padding-top: 20px;
}

.movie-search-input-wrapper {
    position: relative;
    margin-top: 8px;
}

.movie-search-input-wrapper::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 2;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.82;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0c4ca' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
}

#movieSearchQuery:placeholder-shown + #movieSearchClear {
    display: none;
}

.movie-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #aeb3ba;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    box-shadow: none;
}

.movie-search-clear:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-50%);
}

#movieSearchQuery {
    min-height: 54px;
    margin: 0;
    padding: 0 50px 0 48px;
    border: 1px solid #6e737c;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--input-hover-bg), var(--input-bg));
    font-size: 16px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 24px rgba(0, 0, 0, 0.2);
}

#movieSearchQuery:hover {
    border-color: #858b95;
    background: linear-gradient(180deg, #575a62, var(--input-hover-bg));
}

#movieSearchQuery:focus {
    border-color: var(--accent-color);
    background: var(--input-focus-bg);
    box-shadow:
        0 0 0 3px var(--focus-ring),
        0 12px 28px rgba(0, 0, 0, 0.24);
}

#movieSearchQuery::placeholder {
    color: #9ca2aa;
    opacity: 1;
}

.random-rating-trigger {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}

.random-rating-open,
.random-rating-go {
    border: 1px solid rgba(245, 197, 24, 0.75);
    border-radius: 999px;
    color: #17181a;
    background: linear-gradient(135deg, #f5c518, #ffe878);
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(245, 197, 24, 0.16);
}

.random-rating-open {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 9px 18px;
}

.random-rating-open:hover,
.random-rating-go:hover {
    color: #050505;
    background: linear-gradient(135deg, #ffdb4d, #fff0a3);
    border-color: #ffe878;
    transform: translateY(-1px);
}

.random-rating-go {
    min-width: 128px;
}

.random-rating-modal-content {
    color: var(--text-color);
    border: 1px solid rgba(245, 197, 24, 0.32);
    border-radius: 20px;
    background: radial-gradient(circle at top right, rgba(245, 197, 24, 0.1), transparent 38%), #26282d;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.random-rating-modal-content .modal-header,
.random-rating-modal-content .modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

.random-rating-eyebrow {
    color: #f5c518;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.random-rating-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #eef0f3;
    font-weight: 650;
}

#randomRatingValue {
    min-width: 58px;
    padding: 4px 10px;
    border: 1px solid rgba(245, 197, 24, 0.5);
    border-radius: 999px;
    color: #f5c518;
    background: rgba(245, 197, 24, 0.09);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.random-rating-range::-webkit-slider-thumb {
    background: #f5c518;
}

.random-rating-range::-moz-range-thumb {
    background: #f5c518;
    border: 0;
}

.random-rating-scale {
    display: flex;
    justify-content: space-between;
    margin-top: -4px;
    color: #959ba3;
    font-size: 0.78rem;
}

.random-rating-hint {
    margin: 12px 0 0;
    color: #b8bdc5;
    font-size: 0.9rem;
}

.random-rating-result:not(:empty) {
    margin-top: 22px;
}

.random-rating-movie {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: 22px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
}

.random-rating-poster .kinorat-poster-wrapper {
    min-height: 250px;
    aspect-ratio: 2 / 3;
}

.random-rating-details {
    align-self: center;
    min-width: 0;
}

.random-rating-details h3 {
    margin: 8px 0;
    color: #fff;
}

.random-rating-score {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    color: #f5c518;
    font-size: 1.2rem;
    font-weight: 800;
}

.random-rating-meta,
.random-rating-cast,
.random-rating-votes {
    color: #b8bdc5;
}

.random-rating-votes {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.random-rating-imdb-link {
    display: inline-flex;
    padding: 7px 13px;
    border: 1px solid rgba(134, 189, 255, 0.45);
    border-radius: 999px;
}

@media (max-width: 575.98px) {
    .random-rating-movie {
        grid-template-columns: 1fr;
    }

    .random-rating-poster {
        width: min(70vw, 220px);
        margin: 0 auto;
    }

    .random-rating-details {
        text-align: center;
    }
}

/* Center tab content area */
.tab-content {
    margin-top: 15px;
}

.text-left {
    text-align: left;
}

.text-info {
    color: #78b8e8 !important;
}

.text-muted {
    color: var(--muted-text) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: #f08088 !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.badge-info,
.badge.bg-info {
    color: #dceeff;
    background: #355d7a !important;
}

.badge-warning,
.badge.bg-warning {
    color: #261f12;
    background: var(--warning-color) !important;
}

#choicePageWrapper {
    max-width: 1040px;
    margin: 28px auto 0;
    padding: clamp(18px, 3vw, 34px) !important;
    background: rgba(43, 45, 48, 0.82);
    border: 1px solid #42454b;
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 42px var(--shadow-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#flow {
    flex: 1;
    padding: 42px 16px 64px;
}

.info-block {
    padding: 14px 0;
    border-bottom: 1px solid #45484d;
}

.info-block:last-child {
    border-bottom: 0;
}

.info-block label {
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.info-text {
    margin: 4px 0 0;
    color: #eef0f2;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

#actForm .form-control {
    width: 100%;
    max-width: 800px;
    font-size: 16px;
    padding: 10px 14px;
}
#actForm textarea.form-control {
    min-height: 200px;
}

/* act form wider */
#home .feature {
    width: 100%;
    max-width: 900px;   /* змінюй на 1000/1100 при бажанні */
    margin: 0 auto;
}

/* інпути на всю ширину контейнера */
#actForm .form-control,
#actForm textarea.form-control {
    width: 100%;
    max-width: 100%;
}

.header-user-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-user-picture {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.google-login-button {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  font-family: 'Roboto', 'SF Pro Display', Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px rgba(60, 64, 67, 0.08);
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.google-login-button:hover {
  color: #202124;
  background: #f8fafd;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(60, 64, 67, 0.22), 0 4px 8px rgba(60, 64, 67, 0.14);
  transform: translateY(-1px);
}

.google-login-button:active {
  background: #f1f3f4;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
  transform: translateY(0);
}

.google-login-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24s.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
}

#login .bg-dark {
  background: linear-gradient(145deg, #45474c, #3a3c41) !important;
  border: 1px solid #484b51;
  border-radius: var(--radius-lg) !important;
}

.login-welcome-wrap {
  margin-bottom: 24px;
}

.login-welcome-image {
  display: block;
  max-width: 260px;
  width: 70%;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
}

.header-google-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(218, 220, 224, 0.75);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1px;
  text-decoration: none !important;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.header-google-login-button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-color) !important;
  border-color: rgba(218, 220, 224, 0.95);
  box-shadow: none;
  transform: translateY(-1px);
}

.header-google-login-button:active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transform: translateY(0);
}

.header-google-login-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24s.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
}

.header-google-login-button span:not(.header-google-login-icon) {
  display: inline-flex;
  align-items: center;
  height: 100%;
  line-height: 1;
  color: var(--text-color) !important;
}

.kinorat-poster-wrapper {
  position: relative;
  width: 100%;
  min-height: 210px;
  overflow: hidden;
  border-radius: 10px;
  background: #17181a;
  border: 1px solid #45484d;
}

.kinorat-poster-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #17181a 0%, #303237 50%, #17181a 100%);
  background-size: 200% 100%;
  animation: kinoratPosterLoading 1.2s ease-in-out infinite;
}

.kinorat-poster-wrapper.is-loaded::before,
.kinorat-poster-wrapper.is-error::before {
  display: none;
}

.kinorat-poster-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .25s ease, transform .25s ease;
}

.kinorat-poster-wrapper.is-loaded .kinorat-poster-image {
  opacity: 1;
  transform: scale(1);
}

.kinorat-poster-fallback {
  display: none;
  height: 210px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #8c929a;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(0, 0, 0, .25);
  text-align: center;
  font-size: .9rem;
}

.kinorat-poster-wrapper.is-error .kinorat-poster-image {
  display: none;
}

.kinorat-poster-wrapper.is-error .kinorat-poster-fallback {
  display: flex;
}

.kinorat-galaxy-title {
  color: #ffe81f;
  letter-spacing: .08em;
  text-shadow: 0 0 8px rgba(255, 232, 31, .45), 0 0 18px rgba(255, 232, 31, .25);
}

@keyframes kinoratPosterLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.kinorat-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  border: 1px solid rgba(134, 189, 255, 0.58);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.kinorat-share-button:hover {
  color: var(--text-color);
  background-color: var(--btn-hover);
}

.kinorat-share-icon {
  font-size: 15px;
  line-height: 1;
}

.kinorat-share-text,
.kinorat-share-copied {
  display: none;
}

.kinorat-share-button.is-copied .kinorat-share-text {
  display: none;
}

@media (max-width: 768px) {
  #header {
    position: relative;
    z-index: 10000;
    width: 100%;
  }

  #header .navbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand user toggle";
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    overflow: visible;
    border-radius: 0;
    flex-wrap: nowrap !important;
    text-align: left;
  }

  #header .header-brand {
    grid-area: brand;
    min-width: 0;
  }

  #header .header-brand-text {
    font-size: 20px;
  }

  #header .header-mobile-user {
    grid-area: user;
    display: inline-flex !important;
    justify-self: end;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
  }

  #header .header-menu-toggle {
    position: absolute;
    display: block;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  #header .header-menu-button {
    grid-area: toggle;
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    justify-self: end;
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
  }

  #header .header-menu-button:active {
    background: var(--panel-hover);
    transform: translateY(1px);
  }

  #header .header-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    z-index: 3;
    display: none !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - 88px);
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(58, 60, 65, 0.98);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(134, 189, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  #header .header-menu-toggle:checked ~ .header-nav {
    display: grid !important;
  }

  #header .header-nav > a {
    display: flex !important;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-align: left;
  }

  #header .header-nav > a:hover {
    background: var(--panel-hover);
    border-color: rgba(134, 189, 255, 0.18);
  }

  #header .log-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin: 6px 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
  }

  #header .log-form a[href="/userprofile"] {
    display: none !important;
  }

  #header .log-form .btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
    text-align: center;
  }

  #header .header-google-login-button,
  #header nav a.header-google-login-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    width: 100% !important;
    min-height: 48px;
    margin: 8px 0 2px !important;
    padding: 0 16px !important;
    border: 1px solid rgba(218, 220, 224, 0.78) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-color) !important;
    line-height: 1;
    text-align: center !important;
    box-shadow: none;
  }

  #header .header-google-login-button:hover {
    background: rgba(255, 255, 255, 0.17) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
  }

  #header .header-google-login-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  #header .header-google-login-button span:not(.header-google-login-icon) {
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: var(--text-color) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.1px;
  }

  #layoutNotificationBanner,
  #layoutContent .w-50,
  #layoutContent .w-75 {
    width: calc(100% - 24px) !important;
  }

  #layoutContent .p-5 {
    padding: 1rem !important;
  }

  #choicePageWrapper {
    margin-top: 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .nav-tabs {
    border-radius: var(--radius-sm);
  }

  .footer {
    padding: 16px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
