/* General body and HTML styles from index.css for consistency */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #121418;
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    /* Ensure body takes full height */
    display: flex;
    flex-direction: column;
}

/* Header bar for Inspire page */
.header-bar {
    padding: 1rem 1.5rem;
    background-color: #121418;
    /* Match body background */
    /* border-bottom: 1px solid #252830; */
    /* Subtle separator */
    flex-shrink: 0;
    /* Prevent it from shrinking */
    position: relative;
    /* Added for absolute positioning of the button */
    display: flex;
    /* Ensure flex properties apply */
    align-items: center;
    /* Vertically align items */
    justify-content: space-between;
    /* Distribute space between left, center, right */
    width: 100%;
}

.inspire-header-btn {
    background-color: #FFFFFF;
    /* White background */
    color: #121418;
    /* Dark text */
    border: none;
    border-radius: 50px;
    /* Rounded corners */
    padding: 8px 36px;
    /* Adjusted padding */
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: absolute;
    /* Take out of normal flow */
    left: 50%;
    /* Position at 50% from the left */
    transform: translateX(-50%);
    /* Move back by half its own width to truly center */
}

.inspire-header-btn:hover {
    background-color: #f0f0f0;
    /* Slightly darker white on hover */
}

.profile-picture-small-container {
    width: 24px;
    /* To match the size of the editor button on the left */
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-picture-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-editor {
    cursor: pointer;
    padding: 8px 20px;
    background-color: #191B20;
    border-radius: 68px;
    font-weight: 400;
    font-size: 12px;
    line-height: 120%;
    letter-spacing: -1%;
    color: #B3B3B3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Main container for the inspiration bank content */
.inspire-container {
    flex-grow: 1;
    /* Allow it to take remaining vertical space */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1400px;
    /* Increased max-width for wider grid */
    margin: 0 auto;
    margin-top: 2vh;
    /* Center the container */
    width: 100%;
    /* Ensure it takes full width up to max-width */
    box-sizing: border-box;
    /* Include padding in width calculation */
}

.inspire-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.inspire-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 10px;
}

.inspire-subtitle {
    font-size: 1.1rem;
    color: #A0A0A0;
    margin-bottom: 0;
}

.search-section {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.search-input-container {
    display: flex;
    width: 100%;
    max-width: 700px;
    /* Adjusted max-width to match screenshot */
    background-color: transparent;
    border-radius: 50px;
    padding: 0px;
    /* Adjusted padding to match screenshot */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid #DCDCDC;
}

.topic-input {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 1rem;
    padding: 8px 20px;
    /* Adjusted padding to match screenshot */
    border-radius: 50px;
    /* Match container border-radius */
}

.topic-input::placeholder {
    color: #7D7D7D;
}

.search-button {
    background-color: #B4FA04;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    /* Adjusted padding to match screenshot */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    color: #121418;
    font-weight: 400;
    font-size: 0.95rem;
}

.search-button:hover {
    background-color: #aae017;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 800px;
    /* Constrain width for filter buttons */
}

.filter-btn {
    background-color: #191B20;
    color: #B3B3B3;
    border: 1px solid #31353F;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
    background-color: #252830;
    color: #FFFFFF;
}

.filter-btn.active {
    background-color: #B4FA04;
    color: #121418;
    border-color: #B4FA04;
    font-weight: 600;
}


.results-section {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    /* Adjusted minmax for wider cards */
    gap: 25px;
    /* Space between tweet cards */
    padding: 10px;
    box-sizing: border-box;
}

.no-results-message {
    text-align: center;
    color: #888;
    font-size: 1.1rem;
    padding: 30px;
    grid-column: 1 / -1;
    /* Span across all columns */
}

.tweet-card {
    background-color: #121418;
    /* Card background color matching screenshot */
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
    /* Removed shadow to match screenshot */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #31353E;
    /* Border color matching screenshot */
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tweet-card:hover {
    transform: translateY(-3px);
    border-color: #444;
}

.tweet-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.tweet-user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tweet-username {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    display: flex;
    align-items: center;
}

.tweet-handle {
    font-size: 0.85rem;
    color: #B3B3B3;
}

.verified-badge {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    fill: #1DA1F2;
}

.use-button {
    background-color: #B4FA04;
    color: #121418;
    border: none;
    border-radius: 50px;
    padding: 6px 15px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: absolute;
    right: 0;
    top: 0;
}

.use-button:hover {
    background-color: #aae017;
}


.tweet-content p {
    font-size: 0.8rem;
    color: #D0D0D0 !important;
    line-height: 1.6;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.tweet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #5F5F5F;
    font-size: 0.8rem;
    border-top: none;
    /* Removed border-top to match screenshot */
    padding-top: 0;
    /* Removed padding-top to match screenshot */
    margin-top: auto;
}

.tweet-actions span {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s ease;
    /* Removed background, border, padding, margin-right to remove outer boxes */
}

.tweet-actions span:last-child {
    margin-right: 0;
    /* No margin for the last item */
}


.tweet-actions span svg {
    margin-right: 5px;
    fill: #6D6D6D;
    /* Changed to match screenshot */
    width: 16px;
    height: 16px;
    transition: fill 0.2s ease;
}

.tweet-actions span:hover,
.tweet-actions span:hover svg {
    color: #B4FA04;
    fill: #B4FA04;
}

/* Custom Popup Styles (from calendar.css/index.html) */
.custom-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #252830;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-popup.show {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-bar {
        padding: 0.8rem 1rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .inspire-header-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .btn-editor {
        padding: 6px 15px;
        font-size: 10px;
    }

    .inspire-title {
        font-size: 2rem;
    }

    .inspire-subtitle {
        font-size: 0.95rem;
    }

    .search-input-container {
        padding: 6px;
    }

    .topic-input {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .search-button {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .filter-buttons {
        gap: 8px;
        margin-bottom: 25px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .results-section {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 20px;
        padding: 0;
        /* Remove horizontal padding on mobile */
    }

    .tweet-card {
        padding: 15px;
    }

    .tweet-username {
        font-size: 0.9rem;
    }

    .tweet-handle {
        font-size: 0.8rem;
    }

    .tweet-content p {
        font-size: 0.85rem;
    }

    .tweet-actions {
        font-size: 0.75rem;
    }

    .tweet-actions span svg {
        width: 14px;
        height: 14px;
    }

    .use-button {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .search-section {
        padding: 0 10px;
        /* Add horizontal padding to prevent overflow */
        margin-bottom: 25px;
    }

    .search-input-container {
        max-width: 100%;
        /* Ensure full width usage */
        padding: 4px;
        /* Reduce padding */
        flex-direction: row;
        /* Ensure proper flex direction */
        align-items: center;
        min-height: 44px;
        /* Ensure minimum touch target height */
        border: 1px solid #31353F;
        /* Match the design */
        background-color: #191B20;
        /* Add background color for better visibility */
    }

    .topic-input {
        font-size: 0.9rem;
        padding: 8px 15px;
        /* Better padding for mobile */
        min-width: 0;
        /* Allow shrinking */
        flex: 1;
        /* Take available space */
        border-radius: 50px 0 0 50px;
        /* Adjust border radius */
    }

    .topic-input::placeholder {
        color: #7D7D7D;
        font-size: 0.85rem;
        /* Slightly smaller placeholder text */
    }

    .search-button {
        padding: 8px 16px;
        /* Optimized padding for mobile */
        font-size: 0.8rem;
        white-space: nowrap;
        /* Prevent text wrapping */
        border-radius: 50px;
        /* Adjust border radius */
        min-width: auto;
        /* Remove minimum width constraints */
        flex-shrink: 0;
        /* Prevent shrinking */
        font-weight: 500;
        /* Slightly bolder text */
    }

    /* Additional improvements for very small screens */
    @media (max-width: 480px) {
        .search-input-container {
            padding: 3px;
        }

        .topic-input {
            padding: 6px 12px;
            font-size: 0.85rem;
        }

        .search-button {
            padding: 6px 12px;
            font-size: 0.75rem;
        }
    }

    /* Fix for extra small screens */
    @media (max-width: 360px) {
        .search-button {
            padding: 6px 10px;
            font-size: 0.7rem;
        }

        .topic-input {
            padding: 6px 10px;
        }
    }
}