/* Loading Overlay Styles */
.container-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 2;
}
.container-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(74, 144, 226, 0.1);
    border-radius: 50%;
    border-top-color: #4a90e2;
    animation: spin 0.8s ease-in-out infinite;
    margin-bottom: 1rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.thoughts-container {
    position: relative;
    min-height: 220px;
}

/* Regular thought cards */
.thought-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    min-height: 250px; /* Minimum height for consistency */
    padding: 20px;
    background: white;
    border-radius: 12px;
    /* Default neutral shadow */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Directional Shadows for Desktop (2 columns) */
@media (min-width: 769px) {
    /* Left column cards - Shadow to the left */
    .thoughts-container .thought-card:nth-child(odd) {
        box-shadow: -6px 6px 12px rgba(0,0,0,0.08);
    }
    
    /* Right column cards - Shadow to the right */
    .thoughts-container .thought-card:nth-child(even) {
        box-shadow: 6px 6px 12px rgba(0,0,0,0.08);
    }

    /* Hover effects preserving direction */
    .thoughts-container .thought-card:nth-child(odd):hover {
        transform: translateY(-5px);
        box-shadow: -12px 12px 24px rgba(0,0,0,0.12);
    }

    .thoughts-container .thought-card:nth-child(even):hover {
        transform: translateY(-5px);
        box-shadow: 12px 12px 24px rgba(0,0,0,0.12);
    }
}

/* Mobile fallback (neutral shadow) */
@media (max-width: 768px) {
    .thought-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    }
}

.thought-content {
    flex: 1;
    margin-bottom: 0;
    padding-bottom: 140px; /* Space for metadata at bottom */
    display: flex;
    flex-direction: column;
}

.thought-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.thought-card h2 {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    color: #333;
    /* Limit title to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thought-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    /* Limit content to 4 lines */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thought-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #888;
    padding: 12px 20px 20px 20px;
    border-top: 1px solid #eee;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0 0 12px 12px; /* Match card border radius */
}

.thought-category {
    font-weight: 600;
    color: #4a90e2;
    order: 1; /* Category at top */
}

.added-by {
    color: #666;
    order: 2; /* Author in middle */
}

.timestamp {
    color: #999;
    order: 3; /* Time at bottom */
}

/* Reset scroll behavior */
html {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reset any conflicting transitions */
* {
    scrollbar-width: thin;
}

/* Main content area */
.main-content {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Container for thoughts */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    flex: 1;
    position: relative; /* Add this for proper positioning context */
}

/* Thoughts container with fixed height */
.thoughts-container {
    position: relative;
    min-height: 200px; /* Minimum height to prevent layout shift */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    align-items: stretch; /* Ensure cards stretch to fill height */
}

/* Loading container */
.container-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Responsive Base Font Size */
/* Responsive Typography */
html {
    font-size: 16px;
}

body {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.6;
    background: linear-gradient(-45deg, #f5f5f5, #e8f4f8, #f0f0f0, #e8e8e8);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive iframes */
iframe {
    max-width: 100%;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#title {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

/* Hover and focus effects */
.menu > .menu-item:hover,
.menu > .menu-item:focus,
.menu > .menu-item:focus-within {
    z-index: 100;
}

.menu > .menu-item::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, var(--accent), var(--gradient));
    border-radius: 0 0 4px 4px;
    z-index: 1;
    opacity: 0;
    transform: scaleY(0.8);
    transform-origin: top;
    transition: all 0.5s ease;
}

.menu > .menu-item:hover::after,
.menu > .menu-item:focus::after,
.menu > .menu-item:focus-within::after {
    opacity: 1;
    transform: scaleY(1);
    top: 0;
}

/* Sub-menu styles */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2c3e50;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    padding: 0;
    list-style: none;
    border-top: 3px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.menu > .menu-item:hover > .sub-menu,
.menu > .menu-item:focus > .sub-menu,
.menu > .menu-item:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu .menu-item {
    position: relative;
    border-left: 3px solid var(--accent);
    margin: 0 5px 5px;
    transition: all 0.3s ease;
}

.sub-menu .menu-item:last-child {
    margin-bottom: 10px;
}

.sub-menu .menu-item a {
    color: white;
    padding: 10px 15px;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.sub-menu .menu-item a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.sub-menu .menu-item:hover a::after,
.sub-menu .menu-item:focus a::after {
    width: 20px;
}

/* Hover effect for submenu items */
.sub-menu .menu-item:hover,
.sub-menu .menu-item:focus {
    background: rgba(255, 255, 255, 0.1);
}

/* Active state for menu items */
.menu > .menu-item:hover > a:not(:only-child)::after {
    transform: rotate(180deg);
}

/* Responsive Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: white;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Body Styles */
body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Filter Container */
.filter-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin: 1.5rem 0;
    align-items: center;
}

/* Search Input */
#search-thoughts {
    flex: 2;
    min-width: 150px;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#search-thoughts:focus {
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(74, 144, 226, 0.2);
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1) border-box;
    border: 2px solid transparent;
}

/* Custom Dropdown */
.custom-select {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 250px;
    cursor: pointer;
    user-select: none;
    z-index: 1;
}

.selected-option {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    background-color: white;
    color: #333;
    padding-right: 2.5rem;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.selected-option::-ms-expand {
    display: none;
}

.selected-option::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.custom-select.open .selected-option {
    border-radius: 25px 25px 0 0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: none;
}

.custom-select.open .selected-option::after {
    transform: translateY(-50%) rotate(180deg);
}

.options-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 25px 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-top: 0;
    transform: scaleY(0.85);
    transform-origin: top center;
} /* Always absolutely positioned and hidden when closed */

.custom-select.open .options-container {
    opacity: 1;
    pointer-events: auto;
    max-height: none !important; /* Remove fixed height */
    overflow-y: visible !important; /* Remove scrollbar */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 25px 25px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.option {
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select.open .option {
    opacity: 1;
    transform: translateY(0);
}

.option:first-child {
    margin-top: 0;
}

.option:last-child {
    border-radius: 0 0 23px 23px;
}

.option:nth-child(1) { transition-delay: 0.03s; }
.option:nth-child(2) { transition-delay: 0.06s; }
.option:nth-child(3) { transition-delay: 0.09s; }
.option:nth-child(4) { transition-delay: 0.12s; }
.option:nth-child(5) { transition-delay: 0.15s; }
.option:nth-child(6) { transition-delay: 0.18s; }
.option:nth-child(7) { transition-delay: 0.21s; }
.option:nth-child(8) { transition-delay: 0.24s; }
.option:nth-child(9) { transition-delay: 0.27s; }
.option:nth-child(10) { transition-delay: 0.30s; }
.option:nth-child(11) { transition-delay: 0.33s; }
.option:nth-child(12) { transition-delay: 0.36s; }
.option:nth-child(13) { transition-delay: 0.39s; }
.option:nth-child(14) { transition-delay: 0.42s; }
.option:nth-child(15) { transition-delay: 0.45s; }
.option:nth-child(16) { transition-delay: 0.48s; }
.option:nth-child(17) { transition-delay: 0.51s; }
.option:nth-child(18) { transition-delay: 0.54s; }
.option:nth-child(19) { transition-delay: 0.57s; }
.option:nth-child(20) { transition-delay: 0.60s; }

.option:hover {
    background-color: #f8f9fa;
}

.option.active {
    background-color: #e9ecef;
    color: #1a73e8;
}

/* Hide the original select but keep it functional */
.custom-select select, #sort-thoughts {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    z-index: -1 !important;
}

/* Error and Loading States */
.no-thoughts,
.error {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 500px;
}

.no-thoughts p,
.error p {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 1.1rem;
}

.refresh-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.refresh-btn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.error .refresh-btn {
    background-color: #f44336;
}

.error .refresh-btn:hover {
    background-color: #d32f2f;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Navigation Toggle for Mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Navigation Links */
.nav-link {
    color: #063a29ec;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover {
    background-color: #063a29ec;
    color: #fcfbf1;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem;
    }

    .nav-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 0.75rem 0;
    }
}

#title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(45deg, #2c3e50, #4a90e2, #2c3e50);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    transition: transform 0.3s ease;
}

#title:hover {
    transform: scale(1.05);
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 5%;
}

/* Responsive Container */
@media (min-width: 768px) {
    .container {
        padding: 2rem 5%;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 2rem 2%;
    }
}

.quote-section {
    margin: 3rem 0;
}

.quote-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    margin: 2rem 0;
}

.quote-text {
    font-size: 2rem;
    color: #063a29ec;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.quote-author {
    font-style: italic;
    color: #685903;
    font-size: 1.1rem;
}

/* Filter Container */
.filter-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin: 1.5rem 0;
    align-items: center;
}

/* Search Input */
#search-thoughts {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#search-thoughts:focus {
    border-color: #4a90e2;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}

/* Custom Dropdown */
.custom-select {
    position: relative;
    width: 200px;
    cursor: pointer;
    user-select: none;
    z-index: 10; /* Default z-index when closed */
} /* Ensure relative positioning for dropdown */

/* When dropdown is open, give it highest z-index */
.custom-select.open {
    z-index: 10000;
}

/* Category filter specific styles */
#category-filter + .custom-select .options-container {
    max-height: 0;
    overflow: hidden;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 25px 25px;
    z-index: 9999; /* High z-index but less than the parent when open */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-8px);
    transform-origin: top;
    transition: opacity 0.2s ease-out, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform, opacity, max-height;
}

#category-filter + .custom-select.open .options-container {
    max-height: 500px; /* Adjust based on your content */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.2s ease-out, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#category-filter + .custom-select .option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: calc(var(--index) * 0.05s);
}

#category-filter + .custom-select.open .option {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .custom-select {
        width: 100%;
        min-width: 0;
    }
    .thought-card::before {
        opacity: 1 !important;
        transition: none !important;
    }
    .thought-card h2 {
        width: 100%;
        background: linear-gradient(45deg, #55aee9, #7cc588, #f5a623);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

@media (max-width: 992px) {
    .filter-container {
        gap: 0.75rem;
    }
    
    .custom-select {
        min-width: 100%;
    }
}

.selected-option {
    padding: 0.75rem 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main container */
.container {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Reset all grid layouts first */
/* Responsive Grid Layout */
.thoughts-container {
    display: grid;
    gap: 2rem;
    padding: 1.5rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Default to 1 column for mobile first */
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .thoughts-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .thoughts-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .thoughts-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Admin Grid Overrides */
body.admin-page .thoughts-container {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    body.admin-page .thoughts-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    body.admin-page .thoughts-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Thought Card Styles */
.thought-card {
    width: 100%;
    box-sizing: border-box;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
    
}

.thought-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(45deg, #4a90e2, #50e3c2, #f5a623);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thought-card:hover::before {
    opacity: 1;
}

.thought-card h2 {
    margin: 0 0 1rem 0 !important;
    padding-bottom: 0.75rem !important;
    position: relative !important;
    display: inline-block !important;
    color: #333 !important; /* Default solid color */
    transition: all 0.3s ease !important;
}

.thought-card:hover h2 {
    width: 100%;
    background: linear-gradient(45deg, #55aee9, #7cc588, #f5a623);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.thought-card p {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.thought-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
    margin-top: 1.5rem; /* Increased from 1rem */
    padding-top: 1rem; /* Increased from 0.75rem */
    border-top: 1px solid #eee;
}

/* Mobile responsiveness */
@media (max-width: 1200px) {
    /* Keep admin at 3 columns on large tablets */
    body.admin-page .thoughts-grid,
    body.admin-page .thoughts-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 992px) {
    /* On tablets, make admin 2 columns */
    body.admin-page .thoughts-grid,
    body.admin-page .thoughts-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    /* On mobile, single column for both */
    .thoughts-container,
    body.admin-page .thoughts-grid,
    body.admin-page .thoughts-container {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure cards take full width of their container */
.thought-card {
    width: 100%;
    box-sizing: border-box;
}



/* Cards */
.thought-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

/* Animation for sequential appearance */
/* Scroll Reveal Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.thoughts-container .thought-card:nth-child(1) { transition-delay: 0.1s; }
.thoughts-container .thought-card:nth-child(2) { transition-delay: 0.2s; }
.thoughts-container .thought-card:nth-child(3) { transition-delay: 0.3s; }
.thoughts-container .thought-card:nth-child(4) { transition-delay: 0.4s; }

.thought-content {
    flex: 1;
}

.thought-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.thought-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0.5rem;
    border-radius: 15px;
    width: 100%;
    margin-bottom: 2rem;
}

.thought-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.thought-card p {
    color: #666;
    margin-bottom: 1rem;
}

.thought-meta {
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-top: 1rem;
}

/* Delete button styles have been removed */

footer {
    text-align: center;
    padding: 0.1rem;
    margin-top: 0.1rem;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.2;
    background-color: white;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .quote-text {
        font-size: 1.5rem;
    }
    
    .thoughts-grid {
        grid-template-columns: 1fr;
    }
}

.nav-link {
    color: #063a29ec;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover {
    background-color: #063a29ec;
    color: #fcfbf1;
}

.mobile-icon {
    display: none;
    font-size: 1.5rem;
    font-weight: bold;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .desktop-text {
        display: none;
    }
    
    .mobile-icon {
        display: flex;
    }
    
    .nav-link {
        padding: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link:hover {
        transform: rotate(90deg);
    }
    
    .nav-link:hover .mobile-icon {
        transform: rotate(-90deg);
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .quote-text {
        font-size: 1.5rem;
    }
    
    .thoughts-grid {
        grid-template-columns: 1fr;
    }
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background-color: white;
    padding: 0.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.thought-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #27ae60;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: #2980b9;
}

/* Loading animation */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #666;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-thoughts {
    text-align: center;
    color: #666;
    padding: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-message {
    text-align: center;
    padding: 0.5rem;
    color: #d32f2f;
    background-color: #ffebee;
    border-radius: 4px;
    margin: 1rem auto;
    max-width: 600px;
}

.error-details {
    font-family: monospace;
    font-size: 0.8rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    word-break: break-word;
}

.refresh-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.refresh-btn:hover {
    background-color: #1565c0;
}

/* Fade effect */
.thought-card {
    transition: opacity 0.3s ease-in-out;
}

/* Login page specific styles */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 0.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
}

/* Admin page specific styles */
.admin-controls {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 0.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    text-align: center;
}

#otp-input {
    font-size: 1.2rem;
    letter-spacing: 0.5rem;
    text-align: center;
    padding: 0.75rem;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#otp-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* OTP Modal specific styles */
#otp-modal .modal-content {
    text-align: center;
}

#otp-modal .form-group {
    margin-bottom: 1.5rem;
}

#otp-modal .submit-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.login-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.login-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

.login-options {
    margin-top: 1.5rem;
    text-align: center;
}

.skip-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.skip-btn:hover {
    background-color: #7f8c8d;
}

/* User Management Styles */
.user-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.user-card {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    flex: 1;
}

.user-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.user-info p {
    margin: 0.25rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.user-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-status.active {
    background: #2ecc71;
    color: white;
}

.user-status.banned {
    background: #e74c3c;
    color: white;
}

.user-status.restricted {
    background: #f1c40f;
    color: white;
}

.user-restrictions {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.5rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-user-btn,
.toggle-status-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-user-btn {
    background: #3498db;
    color: white;
}

.edit-user-btn:hover {
    background: #2980b9;
}

.toggle-status-btn {
    background: #e74c3c;
    color: white;
}

.toggle-status-btn:hover {
    background: #c0392b;
}

/* User Edit Modal Styles */
#user-edit-modal .modal-content {
    max-width: 500px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* Admin Controls Styles */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stat-card p {
    margin: 0.5rem 0 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: bold;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 2;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.admin-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.admin-btn.danger {
    background: #e74c3c;
}

.admin-btn.danger:hover {
    background: #c0392b;
}

/* User List Styles */
.user-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.user-card {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
}

.user-card:hover {
    transform: translateY(-3px);
}

.user-info {
    flex: 1;
}

.user-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.user-info p {
    margin: 0.25rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.user-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-status.active {
    background: #2ecc71;
    color: white;
}

.user-status.banned {
    background: #e74c3c;
    color: white;
}

.user-status.restricted {
    background: #f1c40f;
    color: white;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-user-btn,
.toggle-status-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-user-btn {
    background: #3498db;
    color: white;
}

.edit-user-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.toggle-status-btn {
    background: #e74c3c;
    color: white;
}

.toggle-status-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Thoughts Grid Styles */
.thoughts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.thought-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 0.95;
}

.thought-card:hover {
    opacity: 1;
}

.thought-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.thought-card:hover h2 {
    color: #3498db;
}

.thought-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.thought-card:hover p {
    color: #555;
}

.thought-meta {
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.thought-category {
    background: #f5f5f5;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-right: 0.5rem;
    border: 1px solid #e0e0e0;
}

.thought-card:hover .thought-meta {
    color: #666;
    border-color: #ddd;
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
}

.thought-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: #c0392b;
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkbox-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Search highlight styles */
.search-highlight {
    background: rgba(74, 144, 226, 0.2);
    border-radius: 2px;
    padding: 0 2px;
    margin: 0 -2px;
    transition: all 0.3s ease;
}

/* Category-specific highlight style */
.thought-category .search-highlight {
    background: rgba(74, 144, 226, 0.3);
    border-radius: inherit;
    padding: inherit;
    margin: 0;
    display: inline-block;
}

/* Mobile specific highlight adjustments */
@media (max-width: 768px) {
    .search-highlight {
        background: rgba(74, 144, 226, 0.15);
        color: #2c3e50;
        font-weight: 500;
    }
    
    .thought-category .search-highlight {
        background: rgba(74, 144, 226, 0.25);
        font-weight: 600;
    }
}

/* Admin Note Styles */
.admin-note {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.admin-note p {
    margin: 0;
}

.file-highlight {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    border: 1px solid #bbdefb;
}
