/* General reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #fafafa;
    color: #333333;
    margin-top: 5rem; /* This margin might push your fixed/absolute header down if not careful */
    font-size: 15.5px !important;
    font-family: 'Arial', sans-serif; /* Added fallback */
    line-height: 1.6;
    padding: 20px; /* Default padding for body */
}

h2 {
    font-size: 24px;
    color: #2d3e50;
    margin-bottom: 10px;
}

/* Typo fixed: text-decordation -> text-decoration */
a {
    text-decoration: none !important;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #1e88e5;
}

ul {
    margin: 0;
}

.bg-steel {
    background-color: #5f788a;
}

.site-header .navbar-nav .nav-link {
    color: #cbd5db;
}

.site-header .navbar-nav .nav-link:hover {
    color: #ffffff;
}

.site-header .navbar-nav .nav-link.active {
    font-weight: 500;
}

.content-section {
    background: #ffffff;
    padding: 10px 20px;
    border: 1px solid #dddddd;
    border-radius: 3px;
    margin-bottom: 20px;
    height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.article-title {
    color: #444444;
}

a.article-title:hover {
    color: #428bca;
    text-decoration: none;
}

.article-content {
    white-space: pre-line;
}

.article-img {
    height: 65px;
    width: 65px;
    margin-right: 16px;
}

.article-metadata {
    padding-bottom: 1px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e3e3e3;
}

.article-metadata a:hover {
    color: #333;
    text-decoration: none;
}

.article-svg {
    width: 25px;
    height: 25px;
    vertical-align: middle;
}

.account-img {
    height: 125px;
    width: 125px;
    margin-right: 20px;
    margin-bottom: 16px;
}

.account-heading {
    font-size: 2.5rem;
}

/* nov styling - consolidated body font */
body {
    margin: 8px; /* Original body margin, this will override the 20px padding from above unless adjusted */
    /* If you want 20px padding and then 8px margin as outer spacing, combine them or define clearly.
       For a fully contained absolute element like login-panel, the body padding is usually what you want.
       Let's stick with the padding: 20px from above. So this line can be removed if padding is desired.
       If you want a small margin around the entire page, keep it.
    */
}

h2 {
    font-family: "Noto Sans", sans-serif !important; /* Added fallback */
    font-size: 1.5em;
}

/* --- HEADER AND NAVIGATION STYLES --- */

.header {
    font-family: "Noto Sans", sans-serif; /* Added fallback font */
    display: flex; /* Use flexbox for horizontal layout */
    justify-content: space-between; /* Pushes logo to left, menu to right */
    align-items: center; /* Vertically centers items */
    width: 100%;
    margin-bottom: 2em;
    border-bottom: 1px solid #666;
    background-color: #ffffff;
    padding: 15px 20px; /* Add some padding */
    box-sizing: border-box; /* Include padding in the width */
    position: relative; /* Important for positioning absolute children on mobile */
}

.logo {
    display: inline-block; /* Ensure logo sits inline */
    margin-right: 2em; /* Space between logo and menu on desktop */
}

.logo img { /* Styles specifically for your image logo */
    max-height: 50px; /* Adjust max height for your logo image */
    width: auto;
    vertical-align: middle; /* Align image with other inline content */
}

/* Menu Container (for desktop) */
.menu {
    font-family: "Noto Sans", sans-serif; /* Added fallback font */
}

/* Remove default list styling */
.menu ul {
    list-style: none; /* Remove bullet points */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
}

/* List items (for desktop) */
.menu li {
    display: inline-block; /* Makes menu items horizontal */
    margin-right: 1em;
    padding-right: 1em;
    border-right: 1px solid #666;
    line-height: 1.2; /* Ensure consistent line height */
    vertical-align: middle; /* Align items if they have different heights */
}

/* Last list item (remove right border) */
.menu li:last-child {
    border-right: none; /* Remove border from the last item */
    margin-right: 0; /* Remove margin from the last item */
    padding-right: 0; /* Remove padding from the last item */
}

/* Menu links */
.menu a {
    color: #000;
    text-decoration: none;
    padding: 5px 0; /* Add some padding for clickable area */
    display: inline-block; /* Ensure padding works correctly */
}

.menu a:hover {
    color: #43cfd9;
}

/* Hamburger Icon (hidden on desktop) */
.hamburger {
    display: none; /* Hide on larger screens */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 100; /* Ensure it's above other content */
    position: relative; /* For bar animations */
    -webkit-tap-highlight-color: transparent; /* Remove highlight on mobile tap */
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #333; /* Make sure this color is visible */
    transition: all 0.3s ease-in-out; /* Smooth transition for bar animation */
    border-radius: 2px;
}


/* --- TABLE STYLING --- */

/* Basic Table Styling (for Desktop View) */
.table { /* Note: This is your specific table class, not a general 'table' tag selector */
    width: 100%;
    border-collapse: collapse; /* Merges table borders */
    margin-bottom: 20px; /* Space below the table */
}

/* Style for table headers */
.table th {
    padding: 12px 8px; /* Top/bottom, left/right padding */
    border: 1px solid #ddd;
    text-align: left;
    background-color: #0078d7; /* Applied your existing header background color */
    color: #fff; /* Header text color */
    font-weight: bold;
}

/* Style for table data cells */
.table td {
    padding: 12px 8px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top; /* Align content to the top */
}

/* Optional: Zebra striping for rows for better readability on desktop */
.table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Style for the article title link */
.table a.article-title {
    /*color: #007bff; /* Bootstrap primary blue, or adjust to your theme */
    text-decoration: none; /* No underline by default */
    display: block; /* Make the link fill the td for easier clicking */
}

.table a.article-title:hover {
    text-decoration: underline; /* Underline on hover */
    color: #0056b3; /* Darker blue on hover */
}

/* Style for the Add button */
button.btn-primary {
    background-color: #0078d7; /* Primary button color */
    color: white; /* Button text color */
    padding: 8px 12px; /* Padding inside the button */
    font-size: 14px; /* Button font size */
    font-weight: bold; /* Bold text */
    border: none; /* Remove button border */
    border-radius: 5px; /* Rounded button corners */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s, transform 0.2s; /* Smooth hover and active effects */
}

/* Button hover effect */
button.btn-primary:hover {
    background-color: #005bb5; /* Darker blue on hover */
}

/* Button active effect */
button.btn-primary:active {
    background-color: #00478f; /* Even darker blue when clicked */
    transform: scale(0.95); /* Slight shrink effect on click */
}

/* --- Login Panel Styles (UPDATED FOR RESPONSIVENESS) --- */
.login-panel {
    /* Centering technique */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Responsive sizing:
       Takes 100% of available width MINUS body's 20px padding on each side.
       This will naturally scale down on mobile but respects the body's padding.
       On desktop, it will cap at 400px.
    */
    width: calc(100% - 40px); /* 100% of parent width minus body's 20px left/right padding (20*2=40) */
    max-width: 400px; /* Max width for desktop (e.g., 400px is a good size for forms) */
    padding: 25px; /* Padding inside the panel for content */
    background-color: #ffffff; /* White background for the panel */
    border: 1px solid #ddd; /* Subtle border */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Soft shadow */
    box-sizing: border-box; /* Include padding/border in width calculation */
}

.login-panel form {
    width: 100%; /* Make form fill the login-panel */
    margin: 0; /* No auto margin here, let panel handle centering of inner elements if any */
}

label {
    font-size: 16px;
    font-family: Helvetica, sans-serif; /* Added fallback */
    display: block; /* Make labels block-level for better spacing */
    margin-bottom: 5px; /* Space between label and input */
}

.login-logo {
    display: block;
    margin: 0 auto 20px auto; /* Center logo and add bottom margin */
    max-width: 150px; /* Prevent logo from being too large */
    height: auto;
}

input[type="submit"] {
    color: #ffffff;
    background-color: #ea9999;
    border: none;
    border-radius: 10px;
    font-family:"Noto Sans", sans-serif; /* Added fallback */
    font-size: 16px;
    font-weight: 600;
    width: 100%; /* Full width of its parent */
    height: 2.5em;
    margin-top: 15px; /* Space above the submit button */
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

#id_username,
#id_password {
    height: 2.5em;
    width: 100%; /* Full width of its parent */
    display: block;
    margin-top: 1em; /* Space between inputs */
    padding: 8px 10px; /* Add some internal padding to inputs */
    border: 1px solid #ccc; /* Subtle border */
    border-radius: 5px; /* Rounded corners for inputs */
    font-family: inherit; /* Inherit font from body/form */
    font-size: 1em; /* Ensure readable font size */
}


.container {
    width: 90% !important;
    margin: auto;
}

.stream-top2 {
    margin: auto;
    display: block;
    width: 100%;
}

.text-input {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    display: block;
    margin: auto;
    padding-inline: 10px;
    font-family: "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

.text-output {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    display: block;
    margin: auto;
    padding-inline: 10px;
    font-family: "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

.book_call {
    width: 60%;
    display: block;
    margin: auto;
    text-align: center;
    padding-top: 3em;
    padding-bottom: 1em;
}

.prompt-button {
    width: 100%;
    height: 35px;
    font-size: 14px;
    font-family: "Noto Sans", sans-serif;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #dfdfdf;
    color: #000000;
    margin-top: 4px;
}

.shorts-button {
    text-align: center;
    margin-top: 1em;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 5px;
    width: 50%;
    margin: auto;
}

.practice-speaking {
    width: 185px;
    height: 35px;
    color: #ffffff;
    background-color: #ea9999 !important;
    border: 1px solid #ea9999 !important;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: auto;
    text-decoration: none !important;
}

.shorts-speaking-button {
    margin-top: 2em;
    display: block;
    text-align: center;
}

#generating-transcript {
    display: none;
    width: 60%;
    margin: auto;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    padding-top: 2em;
}

#generating-text {
    display: none;
    font-size: 20px;
    font-weight: 600;
    margin-top: 2em;
}

.generating {
    display: block;
    margin: auto;
    text-align: center;
    padding-bottom: 1em;
}

.save {
    display: block;
    margin-top: 1em !important;
    width: 185px;
    height: 35px;
    color: #444444;
    background-color: #ffffff !important;
    border: 1px solid #dfdfdf !important;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: auto;
    text-decoration: none !important;
}

/* chat styling */

.active-chat {
    max-height: 82vh;
}

#chat-history h1,
h2 {
    font-size: 1.5em;
    font-family: "Noto Sans", sans-serif;
}

#chat-history::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}

.chatbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 90px;
    background-color: #f4f4f4;
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 0 1em; /* Fixed typo: paddig -> padding */
}

.form-control {
    width: 100%;
    background-color: #f4f4f4;
    border: none;
    vertical-align: middle;
    margin: 0.5em;
    padding: 0; /* Fixed: padding: none -> padding: 0 */
    font-family: "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

.form-control:focus {
    outline: none; /* Prevent focus outline */
    background-color: #f4f4f4; /* Ensure background color stays the same */
    border: none; /* Prevent border changes */
    box-shadow: none; /* Remove any focus shadow */
    padding: 0; /* Fixed: padding: none -> padding: 0 */
}

.send {
    background-color: #f4f4f4;
    color: #000000;
    border: none;
    font-weight: 400;
    margin: 0.5em;
}

.send:hover {
    display: inline-block;
    margin-left: 0.5em;
    background-color: #f4f4f4;
    color: #000000;
    border: none;
    font-weight: 400;
}

.assistant-card {
    background-color: #ffffff !important;
    color: black !important;
    width: 100%;
    border: none;
    padding-top: 2em;
    text-align: left !important;
}

.user-card {
    background-color: #f4f4f4 !important;
    color: #212529 !important;
    border: none;
    display: block;
    width: 100%;
    float: right;
    margin-bottom: 1.25em !important;
    border-radius: 20px;
    margin-right: 1em;
    padding-left: 15px;
    padding-right: 15px;
    text-align: left !important;
}

.card {
    margin-right: 1em;
    border: none;
    width: 100%;
}

.card-header {
    display: none;
}

.card-body {
    width: 75%;
    margin: auto;
}

.active-chat {
    border: none;
}

.container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.col-md-3 {
    width: 17% !important;
    height: 90vh !important;
    background-color: #f8f9fa;
}

.video-container {
    margin-bottom: 2em;
}

.output {
    margin-bottom: 4em;
    width: 100%;
    margin: auto;
}

.shortsplus_speaking {
    display: none; /* hide controls */
}

#start-stream {
    background-color: #ea9999 !important;
    border: 1px solid #ea9999 !important;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: "Noto Sans", sans-serif;
    color: #fff;
    width: 49%;
    height: 35px;
    display: inline-block !important;
}

#stop-media {
    background-color: #666;
    color: #fff;
    width: 49%;
    height: 35px;
    border-radius: 10px;
    font-size: 14px;
    font-family: "Noto Sans", sans-serif;
    display: inline-block !important;
}

.user-style {
    display: block;
    background-color: #f4f4f4 !important;
    color: #212529 !important;
    float: right;
    margin-bottom: 1em !important;
    margin-left: 2em;
    margin-top: 1em;
    border: none;
    max-width: 510px;
    border-radius: 20px;
    padding: 15px;
    text-align: left !important;
    line-height: 1;
    font-size: 15px;
}

.assistant-style {
    background-color: #fff !important;
    color: #212529 !important;
    border: none;
    display: block;
    width: 100%;
    float: left;
    border-radius: 20px;
    margin-right: 2em;
    text-align: left !important;
    line-height: 1.5;
    font-size: 15px;
}

.media-body {
    width: 78%;
    margin: auto;
    line-height: 1.7;
}

.video-controls2 {
    display: block;
    width: 50%;
    margin: auto;
}

.chat-intro h2 {
    font-size: 1.5em;
}

.start_stop {
    text-align: center;
}

.spacer {
    display: block;
}

.video-container {
    display: none;
}

.left {
    background-color: #ffffff;
    border: 1px solid #dddddd;
    height: 90vh;
    float: left;
    width: 35%;
    display: inline-block;
    margin-right: 1em;
    border-radius: 10px;
}

.content-section,
.left {
    box-sizing: border-box;
}

.submit-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 1em;
}

.gap-fill-answer {
    display: block;
    height: 1.4em;
    border-radius: 5px;
    margin-top: 0.5em;
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
    padding-left: 1em;
    padding-right: 1em;
    box-sizing: border-box;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1em;
}

#chat-form {
    margin: 0 auto;
    position: relative;
    width: 100%;
    max-width: 90%;
    padding: 0.5em 1em;
    box-sizing: border-box;
}

/* shortsplus page styling */

/* Style for the table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Table header */
table thead th {
    background-color: #0078d7;
    color: #fff;
    padding: 10px 15px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14px;
}

/* Table rows */
table tbody tr {
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s;
}

/* Row hover effect */
table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Table cells */
table td {
    padding: 10px 15px;
    vertical-align: middle;
}

/* Style for the Add button */
button.btn-primary {
    background-color: #0078d7;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

/* Button hover effect */
button.btn-primary:hover {
    background-color: #005bb5;
}

/* Button active effect */
button.btn-primary:active {
    background-color: #00478f;
    transform: scale(0.95);
}

.row {
    display: inline-block;
    width: 60%;
}

/* --- RESPONSIVE STYLES (MERGED AND ADJUSTED) --- */

@media (max-width: 768px) {
    /* --- Menu & Header Responsive Styles --- */
    .header {
        flex-direction: column; /* Stack logo and hamburger/menu vertically */
        align-items: flex-start; /* Align contents to the left */
        padding: 15px 20px; /* Adjust padding */
    }

    .logo {
        margin-bottom: 15px; /* Space below the logo */
        text-align: center; /* Center the logo text if it's full width */
        width: 100%; /* Make logo take full width to center effectively */
        margin-right: 0; /* Remove desktop margin */
    }

    /* Show the hamburger icon on smaller screens */
    .hamburger {
        display: block; /* Make it visible */
        position: absolute; /* Position it absolutely within the header */
        top: 15px; /* Adjust as needed for alignment */
        right: 20px; /* Adjust as needed for alignment */
    }

    /* Menu on mobile (initially hidden) */
    .menu {
        display: none; /* Hide the entire menu by default on mobile */
        flex-direction: column; /* Stack menu items vertically */
        width: 100%; /* Take full width of the header */
        background-color: #f9f9f9; /* Light background for the dropdown menu */
        position: absolute; /* Position it below the header */
        top: 100%; /* Starts right below the header */
        left: 0;
        z-index: 99; /* Below hamburger, above main content */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow */
        border-top: 1px solid #eee; /* Separator from header */
        padding-bottom: 10px; /* Space at the bottom */
    }

    /* When .menu has the 'active' class, show it */
    .menu.active {
        display: flex; /* Or display: block; depending on preferred layout */
    }

    /* List items on mobile */
    .menu ul {
        width: 100%; /* Ensure ul takes full width */
    }
    .menu li {
        display: block; /* Stack list items vertically */
        width: 100%; /* Make each list item take full width */
        margin: 0; /* Remove horizontal margins */
        padding: 12px 20px; /* Add vertical padding for better spacing */
        border-right: none; /* Remove horizontal border */
        border-bottom: 1px solid #eee; /* Add a subtle separator between stacked items */
        text-align: center; /* Center the text */
        box-sizing: border-box; /* Ensure padding/border are included in width */
        line-height: normal; /* Reset line height for stacking */
    }

    /* Remove bottom border from the last item on mobile */
    .menu li:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Make links fill the entire list item for easier tapping */
    .menu a {
        display: block;
        width: 100%;
        padding: 0; /* Remove original link padding as li handles it */
    }

    /* Hamburger Animation (Optional but nice visual feedback) */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0; /* Middle bar fades out */
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg); /* Top bar rotates and moves down */
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg); /* Bottom bar rotates and moves up */
    }

    /* --- Table Responsive Styles --- */

    /* Hide the table headers (Title, Title, Title) on small screens */
    .table thead {
        display: none;
    }

    /* Make the table, tbody, and tr behave like blocks */
    .table,
    .table tbody,
    .table tr {
        display: block;
        width: 100%; /* Ensure they take full width */
    }

    /* Add visual separation for each conceptual row (which contains 1-3 shorts) */
    .table tr {
        margin-bottom: 15px; /* Space between each group of stacked shorts */
        border: 1px solid #ddd; /* Border around the entire group of stacked shorts */
        box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for better card-like appearance */
        background-color: #fff; /* White background for the "card" */
        border-radius: 8px; /* Slightly rounded corners */
        overflow: hidden; /* Ensures content respects border-radius */
    }

    /* Remove zebra striping on mobile, as rows are now "cards" */
    .table tbody tr:nth-child(even) {
        background-color: transparent;
    }

    /* Make each <td> element take full width and stack */
    .table td {
        display: block; /* Each cell now acts as a block-level element */
        width: 100%; /* Take full width of its parent (the tr) */
        border: none; /* Remove individual cell borders as the tr has a border */
        padding: 12px 15px; /* Adjust padding for stacked view */
        text-align: center; /* Center the title for better appearance on mobile */
    }

    /* Add a subtle top border to separate stacked <td>s within the same <tr> */
    /* This applies to all <td>s that are not the first child in a tr */
    .table tr td + td {
        border-top: 1px solid #eee; /* Light gray separator line */
    }

    /* --- Other Responsive Layout Adjustments --- */
    .left {
        display: none; /* Hide the left sidebar on mobile */
    }

    .row {
        display: block; /* Make .row stack vertically */
        width: 100%; /* Take full width */
    }
}