/* css/pages/mindrooms.css - Updated with Grid Toggle and Animations */

/* Base animation for the page */
main {
    background:  radial-gradient(
                120% 120% at 50% -30%,
                var(--medium-turquoise) 0%,
                var(--medium-off-white) 75%,
                var(--very-light-green)100%
                ) ;
    background-position: center;
    background-size: cover;
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.filter-clear-btn{
    background: none;
    border: none;
    color: var(--dark-turquoise);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s ease;

}
[data-theme="dark"] main{
    background: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sorting-container {
    display: flex;
    justify-content: end;
    margin-top: 3rem;
    margin-right: 1.5rem;
    align-items: center;
    gap: 1rem;
}

.sort-dropdown {
    padding: 0.5rem;
    border: var(--dark-turquoise), 0.05rem, solid;
    border-radius: 0.8rem;
    color: var(--dark-turquoise);
    font-size: 1rem;
    background: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-dropdown:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.sort-dropdown:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    outline: none;
}

.sort-dropdown option {
    color: var(--dark-turquoise);
    font-size: 1rem;
}

/* Grid Toggle Button */
.grid-toggle-btn {
    background: none;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border:none;
}

.grid-toggle-btn:hover {
    transform: translateY(-1px);
}

.grid-toggle-btn img {
    width: 1.5rem;
    height: 1.5rem;
}
.streaming-link-container{
    margin-top:1.5rem;
    color:var(--light-gray)
}
.streaming-link-container a{
    color: var(--light-turquoise)!important;
}
.user-name{
    color:var(--dark-turquoise);
    font-weight:600;
}
.footer-middle{
    color:var(--light-gray);
    font-size: 0.8rem;
    transform: translateX(50px);
}

.participants-count{
    color:var(--light-turquoise);
    padding-right:1rem;
    font-size:0.9rem;
}

.price-indicator{
    font-weight: 300;
    color:var(--very-light-gray);
}

/* Grid View Styles */
.mindrooms-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1080px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 6rem auto;
}
.grid-view .mindroom-card-header{
    display:flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
}

/* List View (Default) */
.mindrooms-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Grid View */
.mindrooms-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.mindrooms-grid.grid-view .mindroom-card {
    animation: cardReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(15px) scale(0.98);
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Grid View */
@media (max-width: 1024px) {
    .mindrooms-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-toggle-btn {
        display: none; /* Hide grid toggle on mobile */
    }
    
    .mindrooms-grid.grid-view {
        grid-template-columns: 1fr;
    }
}

/* Mobile responsive for list view */
@media (max-width: 768px) {
    .mindrooms-grid.list-view .mindroom-card {
        margin: 0 10px;
    }
}

/* Mindroom Card - Updated with animations */
.mindroom-card {
    width: 100%;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid var(--off-white);
    padding: 1.5rem;
    gap: 1rem;
    display: flex;
    flex-direction: column;
    will-change: transform, box-shadow;
    animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for cards */
.mindroom-card:nth-child(1) { animation-delay: 0.1s; }
.mindroom-card:nth-child(2) { animation-delay: 0.2s; }
.mindroom-card:nth-child(3) { animation-delay: 0.3s; }
.mindroom-card:nth-child(4) { animation-delay: 0.4s; }
.mindroom-card:nth-child(5) { animation-delay: 0.5s; }
.mindroom-card:nth-child(6) { animation-delay: 0.6s; }

.mindroom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Rest of your existing card styles remain the same... */
.mindroom-span {
    font-size: 0.9rem;
    color: var(--light-gray);
    font-weight:600;
    transition: color 0.3s ease;
    margin-bottom:1rem;
}

.mindroom-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-gray);
    transition: color 0.3s ease;
}

.mindroom-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color:#7Eb2b0 ;
    padding: 10px 16px;
    border-radius: 2rem;
    font-weight: 500;
    border-color: #7Eb2b0 ;
    border-style: solid;
    border-width: 0.01rem;
    transition: all 0.3s ease;
}

.meta-item:hover {
    background-color: rgba(var(--light-turquoise, 72, 187, 180), 0.1);
    transform: translateY(-1px);
}

.mindroom-description {
    color:var(--light-gray);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-style: italic;
    transition: color 0.3s ease;
}

.mindroom-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-right, .footer-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.rank-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    margin-bottom:1.5rem;
}

.rank-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.5rem;
}

.rank-bar-background {
    flex: 1;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--off-white);
    position: relative;
}
.rank-bar-fill {
    height: 0.7rem;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 70%;
}

/* Rank bar color classes */
.rank-bar-low {
    background-color: #ff6b6b;
}

.rank-bar-mid {
    background-color: #9e9e9e;
}

.rank-bar-high {
    background-color: #26a69a;
}

.rank-bar {
    
    width: 70%;
    height:0.7rem;
    border: var(--light-turquoise);
    border-style: solid;
    border-radius: 2rem;
    border-width: 0.08rem;
}

.user-rank-img {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    transform: scaleX(-1);
    transition: transform 0.3s ease;
}

.mindroom-card:hover .user-rank-img {
    transform: scaleX(-1) rotate(5deg);
}

.join-btn {
    background: var(--dark-turquoise);
    color: var(--white);
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    width:6rem;
}

.join-btn:hover {
    background: var(--light-turquoise);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.join-btn:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

/* Loading State with animation */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-gray);
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dark-gray);
    border-top: 3px solid var(--light-gray);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Pagination animations */
.pagination-container {
    display: flex;
    justify-content: end;
    margin: 2rem 1rem;
    gap: 0.4rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

.page-number, .pagination-btn {
    border: none;
    background: none;
    margin: 0.5rem;
    color: var(--light-gray);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.page-number:hover, .pagination-btn:hover:not(:disabled) {
    color: var(--dark-gray);
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.page-number.active {
    color: var(--dark-turquoise);
    font-weight: 600;
    background-color: rgba(var(--dark-turquoise-rgb, 0, 150, 136), 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Filter bar animations */
.mindrooms-filter-bar {
    opacity: 0;
    transform: translateY(15px);
    animation: slideUpFade 0.5s ease-out 0.2s forwards;
}

.filter-dropdown, .filter-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown:hover, .filter-input:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.filter-dropdown:focus, .filter-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    outline: none;
}

/* Bar button animation */
.bar-button.mindrooms {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top:0;
    text-decoration: none;
    color:var(--dark-gray);
}


.bar-button.mindrooms:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.bar-button.mindrooms:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

/* Hero animation */
.mindrooms-hero {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.header-top-row{
     justify-content: space-between;
     align-items: center;
     display: flex;
     color:var(--light-gray);
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transitions for theme changes */
.mindroom-card,
.filter-dropdown,
.filter-input,
.sort-dropdown,
.join-btn,
.page-number,
.pagination-btn {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .mindroom-card,
    .mindrooms-grid,
    .pagination-container,
    .mindrooms-filter-bar,
    .mindrooms-hero {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width:1200px){
    .mindrooms-grid{
        max-width:80%;
    }
    .mindroom-meta, .mindroom-span, .participants-count {
        display: none;
    }
    

}
@media (max-width:1000px){
    .footer-middle{
        display:none
    }
    .streaming-link-container{
        display:none;
    }
}

/* Mobile specific animations */
@media (max-width: 768px) {
    .mindroom-card {
        transition-duration: 0.2s;
    }
    
    .mindroom-card:hover {
        transform: translateY(-2px);
    }
    
    .join-btn:hover {
        transform: translateY(-1px);
    }
    .mindroom-card-header{
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
    }
   
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}