/*-----Outer Wrapper-------*/

.content{
    padding:1rem 1rem 2rem 1rem;
    display:flex;
    flex-direction:column;
    align-items: center;
    align-self:center;
    width:100%;
}

.contentWrapper{
    display: flex;
    justify-content: center;
}

/*-----Title and Toggle List/Thumbnail-------*/
.content h1{
    font-family:'Fraunces';
    font-weight:900;
    padding: 1rem 1rem 2rem 1rem;
    color:#F53100;
    font-size: 4rem;
}

/*-----Search Indicator-----*/
.search-indicator {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid #F53100;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-indicator p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
}

.search-indicator strong {
    color: #F53100;
}

.view-all-link {
    color: #a31515 !important;
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(245, 49, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    align-self: flex-start;
}

/* Larger screens: switch to row layout */
@media (min-width: 481px) {
    .search-indicator {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
}

.view-all-link:hover {
    background-color: rgba(245, 49, 0, 0.15);
    text-decoration: none;
    transform: translateY(-1px);
}

.toggle{
    gap:0.5rem;
}
.sortOptions{
    padding-bottom: 3rem !important;
    display: flex;
    flex-wrap:wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

 /*------------Modern Sort Dropdown Styling-----------------*/
    .sort-dropdown {
        position: relative;
        display: inline-block;
    }
    
    .sort-dropdown-toggle {
        background: var(--white); 
        border: 1px solid var(--border-light); 
        padding: 0.5rem 0.75rem; 
        margin: 0;
        font-family: 'Poppins', sans-serif;
        font-size: 0.95rem;
        color: var(--text); 
        cursor: pointer; 
        display: flex; 
        align-items: center;
        gap: 0.75rem;
        border-radius: 12px;
        transition: all 0.2s ease;
        font-weight: 500;
        min-width: 160px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .sort-dropdown-toggle:hover {
        border-color: var(--accent-red);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
    }

    .sort-dropdown-toggle:active {
        transform: translateY(0);
    }

    .sort-label {
        color: var(--text-light);
        font-weight: 400;
    }

    .sort-current {
        color: var(--accent-red);
        font-weight: 600;
        flex-grow: 1;
    }
    
    .sort-dropdown-arrow {
        font-size: 0.8em; 
        line-height: 1; 
        color: var(--text-light);
        transition: transform 0.2s ease, color 0.2s ease;
        margin-left: auto;
    }

    .sort-dropdown-toggle:hover .sort-dropdown-arrow {
        color: var(--accent-red);
    }

    .sort-dropdown.active .sort-dropdown-arrow {
        transform: rotate(180deg);
        color: var(--accent-red);
    }
    
    .sort-dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transition: opacity 0.2s ease, transform 0.2s ease;
        margin-top: 0.5rem;
    }
    
    .sort-dropdown-menu.active { 
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .sort-dropdown-menu::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 1.5rem;
        width: 12px;
        height: 12px;
        background-color: var(--white);
        border: 1px solid var(--border-light);
        border-bottom: none;
        border-right: none;
        transform: rotate(45deg);
        z-index: -1;
    }
    
    .sort-dropdown-menu li {
        margin: 0;
        padding: 0 !important;
        list-style: none;
    }

    .sort-dropdown-menu li a {
        display: block; 
        padding: 0.5rem 0.75rem; 
        color: var(--text);
        text-decoration: none; 
        white-space: nowrap;
        font-weight: 500;
        font-size: 0.95rem;
        transition: none;
        border-radius: 0;
        position: relative;
    }

    .sort-dropdown-menu li:first-child a {
        border-radius: 12px 12px 0 0;
    }

    .sort-dropdown-menu li:last-child a {
        border-radius: 0 0 12px 12px;
    }

    .sort-dropdown-menu li:only-child a {
        border-radius: 12px;
    }
    
    .sort-dropdown-menu li a:hover { 
        background-color: var(--primary);
        color: var(--accent-red);
    }

    .sort-dropdown-menu li a.active {
        background-color: var(--white);
        color: var(--accent-red);
        font-weight: 600;
    }

    .sort-dropdown-menu li a.active:hover {
        background-color: rgba(245, 49, 0, 0.12);
        color: var(--accent-red);
    }

    .sort-dropdown-menu li a.active::after {
        content: '✓';
        position: absolute;
        right: 1rem;
        color: var(--accent-red);
        font-weight: bold;
        font-size: 0.9em;
    }

    .sort-dropdown-menu li + li {
        border-top: 1px solid rgba(209, 209, 209, 0.3);
    }

    /* Prevent any visual changes when clicking dropdown items */
    .sort-dropdown-menu li a:active {
        background-color: inherit !important;
        color: inherit !important;
        padding: 0.75rem 1.25rem !important;
        transform: none !important;
        transition: none !important;
    }

    /*------------Modern View Dropdown Styling (Same as Sort)-----------------*/
    .view-dropdown {
        position: relative;
        display: inline-block;
    }

    .view-dropdown-toggle {
        background: var(--white); 
        border: 1px solid var(--border-light); 
        padding: 0.5rem .75rem; 
        margin: 0;
        font-family: 'Poppins', sans-serif;
        font-size: 0.95rem;
        color: var(--text); 
        cursor: pointer; 
        display: flex; 
        align-items: center;
        gap: 0.75rem;
        border-radius: 12px;
        transition: all 0.2s ease;
        font-weight: 500;
        min-width: 160px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .view-dropdown-toggle:hover {
        border-color: var(--accent-red);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
    }

    .view-dropdown-toggle:active {
        transform: translateY(0);
    }

    .view-label {
        color: var(--text-light);
        font-weight: 400;
    }

    .view-current {
        color: var(--accent-red);
        font-weight: 600;
        flex-grow: 1;
    }

    .view-dropdown-arrow {
        font-size: 0.8em; 
        line-height: 1; 
        color: var(--text-light);
        transition: transform 0.2s ease, color 0.2s ease;
        margin-left: auto;
    }

    .view-dropdown-toggle:hover .view-dropdown-arrow {
        color: var(--accent-red);
    }

    .view-dropdown.active .view-dropdown-arrow {
        transform: rotate(180deg);
        color: var(--accent-red);
    }

    .view-dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transition: opacity 0.2s ease, transform 0.2s ease;
        margin-top: 0.5rem;
    }

    .view-dropdown-menu.active { 
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .view-dropdown-menu::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 1.5rem;
        width: 12px;
        height: 12px;
        background-color: var(--white);
        border: 1px solid var(--border-light);
        border-bottom: none;
        border-right: none;
        transform: rotate(45deg);
        z-index: -1;
    }

    .view-dropdown-menu li {
        margin: 0;
        padding: 0 !important;
        list-style: none;
    }

    .view-dropdown-menu li a {
        display: block; 
        padding: 0.75rem 1.25rem; 
        color: var(--text);
        text-decoration: none; 
        white-space: nowrap;
        font-weight: 500;
        font-size: 0.95rem;
        transition: none;
        border-radius: 0;
        position: relative;
    }

    .view-dropdown-menu li:first-child a {
        border-radius: 12px 12px 0 0;
    }

    .view-dropdown-menu li:last-child a {
        border-radius: 0 0 12px 12px;
    }

    .view-dropdown-menu li:only-child a {
        border-radius: 12px;
    }

    .view-dropdown-menu li a:hover { 
        background-color: var(--primary);
        color: var(--accent-red);
    }

    .view-dropdown-menu li a.active {
        background-color: rgba(245, 49, 0, 0.08);
        color: var(--accent-red);
        font-weight: 600;
    }

    .view-dropdown-menu li a.active:hover {
        background-color: rgba(245, 49, 0, 0.12);
        color: var(--accent-red);
    }

    .view-dropdown-menu li a.active::after {
        content: '✓';
        position: absolute;
        right: 1rem;
        color: var(--accent-red);
        font-weight: bold;
        font-size: 0.9em;
    }

    .view-dropdown-menu li + li {
        border-top: 1px solid rgba(209, 209, 209, 0.3);
    }

    /* Prevent any visual changes when clicking dropdown items */
    .view-dropdown-menu li a:active {
        background-color: inherit !important;
        color: inherit !important;
        padding: 0.75rem 1.25rem !important;
        transform: none !important;
        transition: none !important;
    }
  
/*-----------------------*/
/*-----Recipe List-------*/
/*-----------------------*/

.content ul{
    width:100%;
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(18rem, 1fr));
    grid-template-rows: auto;
    gap:2rem;
}

/*------Recipe Wrapper-----*/
.contentRoworCol {
    display: grid;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    grid-template-rows: auto minmax(14rem, auto) auto;
    height: auto;
    grid-template-columns: 1fr;
    padding-bottom: 1rem;
}

/*-----Recipe Title-----*/
.content ul li{
    list-style:none; 
    font-size:1.1rem;
    padding:0.25rem 0;
    text-align:center;
 }

 .content a, .content a:visited{
    color:rgb(0, 0, 0);
    text-decoration:none;
}

/*------Recipe Thumbnail-----------*/
img.recipeImg {
    display: block;
    width: 100%;
    height: 13rem;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

img.recipeImg.loaded {
    opacity: 1;
}

img.recipeImg.error {
    opacity: 1;
}

/*------------Buttons Row-----------*/
.buttons.row{
    justify-content: center;
}

.deleteBtn, .editBtn, .favouriteBtn, .shoppingListBtn{
    display: flex;
    align-items: center;
    border:none;
    background-color: #FFF7ED;
}

.deleteBtn img, .editBtn img, .favouriteBtn img, .shoppingListBtn img {
    height: 1.5rem;
}

/*-----------------------------------------*/
/* --------- Pagination Row ------------- */
/*-----------------------------------------*/
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0 1rem 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    background-color: var(--primary);
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
}

.pagination a:hover {
    background-color: var(--primary);
    color: var(--text);
    border-color: var(--primary);
}

.pagination .current {
    background-color: var(--accent-red);
    color: var(--primary);
    border-color: var(--accent-red);
    font-weight: bold;
}

@media only screen and (min-width: 600px) {
    @media only screen and (max-width: 1200px) {
        .content{
            width:90%;
        }
        .content h1{
            font-size: 5rem;
        }
    }
}

@media only screen and (min-width: 1200px) {
    .content{
        width:90%;
    }
    .content h1{
        font-size: 5rem;
    }
}
