/* ============================================
   app.css – Minimal overrides for Tailwind CDN
   Only things Tailwind can't do inline
   ============================================ */

/* --- Design tokens --- */
:root {
    --brand: #0B9444;
    --brand-dark: #087635;
    --brand-light: #e6f5ec;
    --greyblue: #6182A5;
    --orange: #FFB851;
    --grey: #3A413B;
    --dark: #092032;
    --body: #373737;
    --greyish: #DCE3EB;
    --greyline: #949494;
}

/* --- Tailwind shadow overrides: bottom-directed --- */
.shadow-lg {
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.25) !important;
}

.shadow-xl,
.hover\:shadow-xl:hover {
    box-shadow: 0 18px 30px -6px rgba(0, 0, 0, 0.3) !important;
}

/* --- Smooth scrolling --- */
html {
    scroll-behavior: smooth;
}

/* --- Base body --- */
body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--body);
    background-color: #F6F6F6;
    background-image: url("../img/back-radon-1.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Global transitions for interactive elements --- */
a,
button,
input[type=submit] {
    transition: all 0.2s ease;
}

/* --- Logo in navbar --- */
.nav-logo {
    margin-left: 6px;
    margin-top: 6px;
    height: 52px;
    width: auto;
}

/* --- Full-width images --- */
#headerImage {
    width: 100%;
}

.Content img {
    max-width: 100%;
}

.Content iframe {
    max-width: 100%;
}

.Content video {
    max-width: 90%;
}

/* --- Links --- */
a {
    color: var(--dark);
    text-decoration: none;
}

a:hover {
    color: var(--brand);
}

/* --- Chat --- */
#chatbox {
    text-align: left;
    margin: 0 auto 25px;
    padding: 10px;
    background: #fff;
    height: 60vh;
    width: 100%;
    overflow: auto;
}

.msgln {
    margin: 0 0 4px 0;
    font-size: 0.82rem;
    line-height: 1.6;
    position: relative;
    padding-right: 60px;
}

.msgln span.left-info {
    color: orangered;
}

.msgln span.chat-message {
    display: inline;
}

.msgln span.chat-time {
    color: #aaa;
    font-size: 0.73rem;
    position: absolute;
    top: 0;
    right: 0;
}

.msgln b.user-name,
.msgln b.user-name-left {
    font-weight: 600;
    background: #546e7a;
    color: white;
    padding: 1px 5px;
    font-size: 0.78rem;
    border-radius: 3px;
    white-space: nowrap;
    margin-right: 4px;
}

/* Chat message statuses */
.msgln.msg-pending {
    opacity: 0.6;
    border-left: 3px solid #ffc107;
    padding-left: 8px;
}

.msgln.msg-techsupport {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

#chatbox .msgln.msg-techsupport::before {
    content: "🎧 Skickat till support — bara du ser detta";
    display: block;
    font-size: 11px;
    color: #0c5460;
    font-weight: bold;
    margin-bottom: 4px;
}

.msgln.msg-tech-reply {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

#chatbox .msgln.msg-tech-reply::before {
    content: "💬 Svar från support — bara du ser detta";
    display: block;
    font-size: 11px;
    color: #155724;
    font-weight: bold;
    margin-bottom: 4px;
}

/* msg-hidden: no visual effect in public view — managed via moderator backend */

/* Moderator actions */
.mod-action {
    font-size: 12px;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
}

.mod-action.mod-live {
    color: #28a745;
}

.mod-action.mod-hide {
    color: #dc3545;
}

.mod-action.mod-tech {
    color: #17a2b8;
}

.mod-action:hover {
    opacity: 0.7;
}

/* --- Countdown Timer --- */
.count-down-wrapper {
    position: relative;
    top: 150px;
    text-shadow: 1px 1px 2px #000;
}

.count-down-wrapper .separator {
    display: none !important;
}

.count-down-wrapper .countdown-container {
    font-family: Montserrat, sans-serif;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.count-down-wrapper .countdown {
    display: flex;
    transform-style: preserve3d;
    perspective: 500px;
    height: 10rem;
    margin: 0 auto;
}

.count-down-wrapper .countdown.remove {
    animation: hide-countdown 1s cubic-bezier(0, 0.9, 0.56, 1.2) forwards;
    overflow: hidden;
}

.count-down-wrapper .number,
.count-down-wrapper .separator {
    display: block;
    color: #FFF;
    height: 10rem;
    font-size: 10rem;
    position: relative;
    line-height: 10rem;
    text-align: center;
    width: 100%;
}

.count-down-wrapper .separator {
    margin: 0;
    width: 2rem;
}

.count-down-wrapper .new,
.count-down-wrapper .old,
.count-down-wrapper .current {
    color: #FFF;
    position: absolute;
    border-radius: 1rem;
    height: 10rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.count-down-wrapper .new {
    animation: show-new 0.4s cubic-bezier(0, 0.9, 0.5, 1.2) forwards;
}

.count-down-wrapper .old {
    animation: hide-old 2s cubic-bezier(0, 0.9, 0.56, 1.2) forwards;
}

.count-down-wrapper .countdown section {
    position: relative;
}

.count-down-wrapper #js-days:after,
.count-down-wrapper #js-hours:after,
.count-down-wrapper #js-minutes:after,
.count-down-wrapper #js-seconds:after {
    content: "Dagar";
    position: absolute;
    text-align: center;
    left: 0;
    right: 0;
    bottom: -80px;
    font-size: 22px;
}

.count-down-wrapper #js-hours:after {
    content: "Timmar";
}

.count-down-wrapper #js-minutes:after {
    content: "Minuter";
}

.count-down-wrapper #js-seconds:after {
    content: "Sekunder";
}

@keyframes hide-countdown {
    to {
        height: 0;
        overflow: hidden;
    }
}

@keyframes show-new {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-2rem) scale(0.8) rotateX(-20deg);
    }

    100% {
        transform: translate(-50%, -50%);
    }
}

@keyframes hide-old {
    0% {
        transform: translate(-50%, -50%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-5rem) scale(0.5) rotateX(-75deg);
    }
}

/* Countdown responsive */
@media (max-width: 992px) {
    body#ID1 section.firstsection {
        margin-top: 33px;
    }

    .count-down-wrapper {
        /* position: static; */
        /* text-shadow: none; */

        position: relative;
        text-shadow: none;
        top: -148px !important;
    }

    .count-down-wrapper .countdown-container {
        max-width: 70vw;
    }

    .count-down-wrapper .separator {
        display: none;
    }

    .count-down-wrapper * {
        color: #333 !important;
        font-size: 2rem !important;
    }
}

@media (max-width: 1200px) {
    .count-down-wrapper {
        top: 50px;
    }
}

@media (max-width: 700px) {
    .countdown-container {
        max-width: 100% !important;
    }

    .countdown-container * {
        font-size: 2rem !important;
    }

    #js-days:after,
    #js-hours:after,
    #js-minutes:after,
    #js-seconds:after {
        font-size: 15px !important;
    }
}

/* --- Navbar toggler icon --- */
.navbar-toggler-icon {
    background: url(../img/menu_expander.png);
    background-repeat: no-repeat;
    width: 30px;
    height: 30px;
    display: inline-block;
}

/* --- Bootstrap compat: d-none/d-block --- */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

/* --- Login form styling --- */
#MemberLoginForm_LoginForm fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

#MemberLoginForm_LoginForm .field {
    margin-bottom: 1.25rem;
}

#MemberLoginForm_LoginForm label.left {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

#MemberLoginForm_LoginForm .middleColumn {
    width: 100%;
    margin-left: 0;
}

#MemberLoginForm_LoginForm input.text,
#MemberLoginForm_LoginForm input.password {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: #1f2937;
    width: 100%;
    transition: all 0.2s ease;
}

#MemberLoginForm_LoginForm input.text:focus,
#MemberLoginForm_LoginForm input.password:focus {
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 148, 68, 0.3);
    outline: none;
}

#MemberLoginForm_LoginForm .checkbox {
    margin-top: 0.5rem;
}

#MemberLoginForm_LoginForm .field.checkbox label.right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    cursor: pointer;
    float: none;
}

#MemberLoginForm_LoginForm .field.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
    flex-shrink: 0;
}

#MemberLoginForm_LoginForm #ForgotPassword {
    margin: 0;
}

#MemberLoginForm_LoginForm #ForgotPassword a {
    color: var(--brand);
    font-weight: 500;
    font-size: 0.85rem;
}

#MemberLoginForm_LoginForm .btn-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 1rem;
}

#MemberLoginForm_LoginForm .action.btn {
    background: linear-gradient(135deg, var(--brand), #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(11, 148, 68, 0.5);
    transition: all 0.2s ease;
}

#MemberLoginForm_LoginForm .action.btn:hover {
    box-shadow: 0 4px 16px rgba(11, 148, 68, 0.6);
    transform: translateY(-1px);
}

#MemberLoginForm_LoginForm .clear {
    clear: both;
}

/* --- SilverStripe Forms (Profile + Register) --- */
#Form_ProfileForm,
#Form_RegisterForm {
    max-width: 960px;
}

/* content-container for login/register pages */
.content-container.typography {
    max-width: 960px;
    margin: 0 auto;
}

.content-container.typography h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-container.typography p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.content-container.typography a {
    color: var(--brand);
    font-weight: 500;
}

#Form_ProfileForm fieldset,
#Form_RegisterForm fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Field wrappers */
#Form_ProfileForm .field,
#Form_RegisterForm .field {
    margin-bottom: 1.5rem;
}

/* Labels */
#Form_ProfileForm label.left,
#Form_RegisterForm label.left {
    display: block;
    float: none;
    width: 100%;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

/* Hide the "random password" helper text */
#Form_RegisterForm label.right {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.3rem;
    float: none;
}

/* middleColumn – SilverStripe wrapper around inputs */
#Form_ProfileForm .middleColumn,
#Form_RegisterForm .middleColumn {
    width: 100%;
    margin-left: 0;
}

/* Text inputs */
#Form_ProfileForm .form-control,
#Form_ProfileForm input.text,
#Form_ProfileForm input.password,
#Form_RegisterForm .form-control,
#Form_RegisterForm input.text,
#Form_RegisterForm input.password {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    height: auto;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: #1f2937;
    width: 100%;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

#Form_ProfileForm .form-control:focus,
#Form_ProfileForm input.text:focus,
#Form_ProfileForm input.password:focus,
#Form_RegisterForm .form-control:focus,
#Form_RegisterForm input.text:focus,
#Form_RegisterForm input.password:focus {
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 148, 68, 0.3);
    outline: none;
}

/* Password toggle section */
#Form_ProfileForm .showOnClick>a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(11, 148, 68, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

#Form_ProfileForm .showOnClick>a:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

#Form_ProfileForm .showOnClick>a::before {
    content: "🔒";
}

/* Password fields container – smooth expand */
#Form_ProfileForm .showOnClickContainer {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

#Form_ProfileForm .showOnClickContainer.d-block,
#Form_ProfileForm .showOnClickContainer:not(.d-none) {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

/* Keep d-none working for initial state */
#Form_ProfileForm .showOnClickContainer.d-none {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    display: block !important;
    /* override d-none to allow CSS transition */
    visibility: hidden;
    height: 0;
}

/* Password fields inner styling */
#Form_ProfileForm .showOnClickContainer .field {
    padding: 1rem 1.25rem;
    background: #f0fdf4;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid #d1fae5;
}

#Form_ProfileForm .showOnClickContainer .field label.left {
    color: var(--brand-dark);
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

#Form_ProfileForm .showOnClickContainer input.password {
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    width: 100%;
}

#Form_ProfileForm .showOnClickContainer input.password:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 148, 68, 0.35);
    outline: none;
}

/* Submit button area */
#Form_ProfileForm .btn-toolbar {
    padding: 1.5rem 0 0.5rem;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #f3f4f6;
    margin-top: 1rem;
}

#Form_ProfileForm .btn-toolbar .btn,
#Form_ProfileForm .btn-toolbar .btn-primary {
    float: none;
    background: linear-gradient(135deg, var(--brand), #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(11, 148, 68, 0.5);
}

#Form_ProfileForm .btn-toolbar .btn:hover,
#Form_ProfileForm .btn-toolbar .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(11, 148, 68, 0.6);
    transform: translateY(-1px);
}

/* Error/message styling */
#Form_ProfileForm .message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Clear float helper */
#Form_ProfileForm .clear {
    clear: both;
}

/* --- Generic form controls (non-profile forms) --- */
.form-control {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    height: auto;
    padding: 0.65rem 1rem;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 148, 68, 0.3);
    outline: none;
}

textarea.form-control:focus {
    min-height: 10rem;
}

fieldset div:focus-within {
    color: #000;
}

form .btn-toolbar {
    padding: 2rem 0;
    display: block;
}

form .btn-toolbar .btn,
form .btn-toolbar .btn-primary {
    float: right;
    background: linear-gradient(135deg, var(--brand), #059669);
    color: #fff;
    border: none;
    text-decoration: none;
    border-radius: 10px;
    padding: 10px 28px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(11, 148, 68, 0.5);
    transition: all 0.2s ease;
}

form .btn-toolbar .btn:hover,
form .btn-toolbar .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(11, 148, 68, 0.6);
    transform: translateY(-1px);
}

/* --- Expo content headings --- */
.mainexpo .Content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.mainexpo .Content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.mainexpo .Content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4b5563;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- YouTube Modal (vanilla) --- */
.yt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
}

.yt-modal-overlay.active {
    display: flex;
}

.yt-modal-dialog {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    overflow: hidden;
}

.yt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.yt-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.yt-modal-close:hover {
    color: #000;
}

.yt-modal-body {
    padding: 0;
}

/* --- Responsive video embeds (SilverStripe HTMLEditor sets fixed pixel widths) --- */
.ss-htmleditorfield-file.embed {
    max-width: 100% !important;
    width: 100% !important;
}

.ss-htmleditorfield-file.embed iframe {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}

/* --- Countdown labels: smaller offset on narrow screens --- */
@media (max-width: 995px) {
    .count-down-wrapper #js-days:after,
    .count-down-wrapper #js-hours:after,
    .count-down-wrapper #js-minutes:after,
    .count-down-wrapper #js-seconds:after {
        bottom: -34px;
    }
}