/* Base styles */
:root {
    --background: #0a131a;
    --primary: white;
    --secondary: #3a4c57;
    --dark-background:black;
    --functional:#94a3b8;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* translucent dark layer */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;                   /* below popup, above everything else */
    display: none;                  /* hidden by default */
}

.thread__corner {
    display: flex;
    justify-content: flex-end; /* Horizontal: Right */
    align-items: flex-start;
    color: #8e8e8e/* Vertical: Top */
}

.thread__corner img {
    padding: 10px;
    display: inline-flex;            /* removes inline-img whitespace */
    width: 32px;               /* or whatever size you need */
    height: 32px;
    filter: invert(1) brightness(2);
    /* keep aspect-ratio or set both */
}

body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
    background-color: var(--dark-background);
    -webkit-font-smoothing: antialiased;
    color: var(--primary);
    font-variation-settings: "wdth" 100;
}

.tweet-content {
    flex: 1;
    min-width: 0;
}

/* Layout */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--background);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

/* Header Flex Grid */
.header__flex-grid {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 32px;
}

.header__spacer-left {
    flex: 1;
    min-width: 0;
}

.header__spacer-right {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

/* Navigation Tabs */
.header__tabs {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0 auto;
}

.header_logo {
    height: 30px;
    display: flex;
    align-items: center;
}

.header_logo img {
    height: 100%;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.create-post-form {
    padding-left: 5px;
    display: grid;
    row-gap: 1px;
    grid-template-columns: auto 32px;
    grid-template-rows: 20px auto auto 20px 20px;
    grid-template-areas:
    "header sidemenu"
    "main main"
    "image image"
    "time time"
    "footer footer";
}

.secondary {
    order: 1;
    font-weight: bold;
}

.tab-link:hover {
    color: #ccc;
}

.tab-link.active {
    color: #fff;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
}

/* Daily Whinge Grid Layout */
.daily-layout {
    min-height: 100vh;
    background-color: var(--background);
    padding-top: 60px; /* Account for fixed header */
}

.daily-main {
    width: 100%;
    padding: 20px;
}

.daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 640px);
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center;
}

.daily-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    break-inside: avoid;
    margin-bottom: 0;
}

.daily-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for daily grid */
@media (max-width: 768px) {
    .daily-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }
    
    .daily-main {
        padding: 16px 0;
    }
    
    /* Mobile header adjustments */
    .header {
        padding: 0 16px;
    }
    
    .header__flex-grid {
        gap: 16px;
    }
    
    .header__tabs {
        gap: 1rem;
    }
    
    .tab-link {
        font-size: 14px;
        padding: 6px 0;
    }
    
    /* Mobile auth buttons adjustments */
    .auth_buttons {
        gap: 6px;
    }
    
    .auth-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .auth-btn span {
        display: none; /* Hide text on mobile, show only icons */
    }
    
    .auth-btn i {
        font-size: 14px;
    }
    
    /* Mobile floating editor adjustments */
    #floatingEditor {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
    }
    
    #floatingBtn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    /* Mobile composer adjustments */
    .composer__form {
        padding: 16px;
    }
    
    .user-input {
        padding: 12px 16px;
        max-width: 100%;
    }
    
    .composer__actions {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .composer__inputs {
        gap: 8px;
    }
    
        .actionBase {
            padding: 8px;
            font-size: 14px;
        }
        
        /* Hide scroll bars on mobile */
        * {
            scrollbar-width: none !important; /* Firefox */
            -ms-overflow-style: none !important; /* IE and Edge */
        }
        
        *::-webkit-scrollbar {
            display: none !important; /* Chrome, Safari, Opera */
        }
        
        /* Ensure floating editor scrolling works without visible scrollbars */
        #floatingEditor {
            overflow-y: auto !important;
            scrollbar-width: none !important;
            -ms-overflow-style: none !important;
            -webkit-overflow-scrolling: touch;
        }
        
        #floatingEditor::-webkit-scrollbar {
            display: none !important;
        }
    }

@media (min-width: 1200px) {
    .daily-grid {
        grid-template-columns: repeat(auto-fill, 640px);
        gap: 24px;
    }
}

.composer__textarea {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 15px;
    resize: none;
    padding: 8px 0;
}

.composer__textarea::placeholder {
    color: #8e8e8e;
}

.composer__textarea:focus {
    outline: none;
}

.composer__submit {
    background-color: #999;
    color: black;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.composer__submit:hover {
    opacity: 0.9;
}

.composer__inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.composer__select {
    background-color: var(--surface);
    color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
}

.composer__image-upload {
    display: inline-flex;
    align-items: center;
    color: grey;
    justify-content: center;
    width: 33px;
    height: 33px;
    border-radius: 8px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.composer__image-upload:hover {
    background-color: var(--border);
}

.composer__image-input {
    display: none;
    color: #8e8e8e;
}

#entityDynamicInput::placeholder {
    font-size: 15px;
}

.composer__image-preview {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.image-preview-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.image-preview-container .remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.image-preview-container .remove-image:hover {
    background: #cc0000;
}

.name {
    font-weight: normal;
    font-size: 15px;
    color: var(--secondary);
}

/* Thread */
.thread {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 8px;
    border-bottom: 1px solid var(--border);
    background-color: #141317;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content .avatar {
    flex-shrink: 0;
    margin-right: 0;
}

.threads {
    max-width: 640px;
    margin: 0 auto;
    background-color: var(--background);
    display: flex;
    flex-direction: column;
}

.tweet:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.thread__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    float: left;
    margin-right: 0.75rem;
}

.thread__author {
    flex: 1;
}

.container {
    display: flex; /* or inline-flex */
    align-content: flex-end;
}

.input_with_tick {
    display: flex;
    color: var(--functional);
    gap: 8px;
}

.thread__timestamp {
    color: var(--primary);
}

.thread__content {
    margin-bottom: 10px;
}

.thread__appeal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--surface);
    border-radius: 16px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.thread__appeal-icon {
    width: 16px;
    height: 16px;
}

.thread__appeal-text {
    color: var(--secondary);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Response message */
.response-message {
    color: #4CAF50;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* No whinges found message */
.no-whinges {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.no-whinges-content {
    text-align: center;
    color: #888;
    max-width: 400px;
}

.no-whinges-content i {
    font-size: 4rem;
    color: #555;
}

.no-whinges-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.no-whinges-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.compose-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.compose-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.compose-btn i {
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive design */
@media (max-width: 600px) {
    .main-content {
        padding: 0;
    }

    .composer, .thread {
        padding: 12px;
    }
    
    .message-content {
        gap: 8px;
    }
    
    .message-content .avatar {
        width: 32px;
        height: 32px;
    }
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--surface);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Image handling */
.image-preview-container {
    position: relative;
    display: inline-block;
    margin: 8px 0;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.remove-image:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Header navigation */
.header__nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.header__back {
    color: var(--primary);
    text-decoration: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header__back:hover {
    background-color: var(--surface);
}

/* Post view */
.post {
    margin-bottom: 24px;
}

.main-thread {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 24px;
}

.reply-thread {
    padding-left: 48px;
    position: relative;
}

.reply-thread::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border);
}

.thread.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.thread.clickable:hover {
    background-color: var(--surface);
}

.thread__hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.thread__hashtag {
    background-color: var(--surface);
    color: var(--secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.thread__hashtag:hover {
    background-color: var(--border);
    color: var(--primary);
}

#container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gauge-button {
    background-color: var(--surface);
    color: var(--secondary);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    height: 100%; /* optional — if your buttons have fixed height */
}

.image-upload i {
    line-height: 1; /* prevent icon misalignment */
}

.actionBtn, .image-upload {
    vertical-align: middle;
    font-size: larger;
}

.actionBase {
    background-color: var(--surface);
    color: #999999;
    border-radius: 6px;
    border: 1px solid var(--border);
    padding: 7px 7px;
    cursor: pointer;
    transition: opacity 0.2s;
    overflow: hidden;
    white-space: nowrap;
}

.image-upload,
.actionBtn {
    text-overflow: ellipsis;
    max-width: 80px;
    /* or any width */
}

.actionBtn:disabled {
    color: var(--secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px 14px;
    cursor: not-allowed;
    opacity: 0.6;
    transition: opacity 0.2s;
}

button.delete-btn { background: #e74c3c; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 4px; cursor: pointer; }
button.delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#dynamicInput {
    padding: 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface);
    color: #ffffff; /* Change this value to any desired color */
}

#entityDynamicInput {
    padding: 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface);
    color: #ffffff; /* Change this value to any desired color */
}

#dynamicInput::placeholder {
    color: #ffffff; /* Change to desired placeholder color */
    opacity: 60%; /* Override default opacity in some browsers */
}

#entityDynamicInput::placeholder {
    color: #ffffff; /* Change to desired placeholder color */
    opacity: 60%; /* Override default opacity in some browsers */
}

.thread:not(.reply-thread) {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.thread:not(.reply-thread):hover {
    background-color: antiquewhite;
}

.gauges {
    display: none;
}

.gauges.active {
    display: flex;
    cursor: pointer;
}

.menu-button {
    flex: 0 0 auto;        /* in flex parents, don’t grow */
    justify-self: start;
    background-color: var(--secondary);
    color: var(--background);
    border: #333 solid 1px;
    padding: 10px 10px;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 900;
    transition: background-color 0.3s ease;
    font-family: sans-serif;
}

.relation {
    color: grey;
}

.login_required {
    background: var(--secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow: auto;
    padding: 24px;
    text-align: center;
}
