/* DEFAULT LAYOUT: three cards per row */
#equation-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  #equation-list li {
    width: 100%; /* let the grid cell handle sizing */
  }

/* Home view layout override */
#equation-list.home-view {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    grid-template-columns: none !important; /* Disable grid layout */
    gap: 0 !important; /* Remove gaps */
    padding: 0 !important;
    margin: 0 auto !important;
}

/*nav bar styles*/

.nav-link {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    margin-right: 15px;
    transition: color 0.3s;
}

.nav-link {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    margin-right: 15px;
    display: flex;
    align-items: center;
}
.cta-button {
    background-color: #2563eb;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.cta-button:hover {
    background-color: #1e4dd8;
    transform: translateY(-1px);
}

.ctaf-button {
    background-color: #2564eb;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 150px;
}
.ctaf-button:hover {
    background-color: #1e4dd8;
    transform: translateY(-1px);
}



        .popup {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            max-width: 500px;
            background: white;
            padding: 20px;
            border: 1px solid black;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
        }
        .popup-content {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 20px;
            max-height: 75vh;
            overflow-y: auto;
        }
        .icon-button {
            background: none;
            border: none;
            color: gray;
            cursor: pointer;
            padding: 5px;
            font-size: 16px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .icon-button:hover {
            transform: scale(1.1);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }
        .close {
            align-self: flex-end;
            cursor: pointer;
            font-size: 20px;
        }
        #delete-popup {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border: 1px solid black;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
        }
 

#equation-list li {
    background: #fff;
    width: 260px;
    height: 200px;
    padding: 20px;
    margin: 0;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#equation-list li:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
        .tabbed-interface {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            gap: 15px; /* Add spacing between buttons */
        }
        .tab-button {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 50px;  /* Ensure the width is consistent for all buttons */
            height: 40px; /* Ensure the height is consistent for all buttons */
            padding: 10px;
            border: none;
            background-color: #ffffff;
            color: #000000;
            cursor: pointer;
            transition: background-color 0.3s;
            border-radius: 5px;
        }
        .tab-button:hover, .tab-button.active {
            background-color: #dbd3d8;
            color: rgb(0, 0, 0);
        }
        .tab-button:last-child {
            margin-right: 0;
        }
        button {
        background: #2563eb;
        color: white;
        padding: 10px 20px;
        cursor: pointer;
        border-radius: 8px;
        transition: 0.3s;
    }
    #equation-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Responsive grid */
        gap: 20px; /* Space between cards */
        justify-content: center; /* Center the grid */
        list-style: none;
        padding: 0;
        margin: 30px 0; /* Add more margin from the divider */
    }

    #equation-list li {
        background: #fff;
        width: 100%; /* Let the grid cell handle sizing */
        max-width: 260px; /* Ensure consistent card width */
        height: 200px;
        padding: 20px;
        margin: 0 auto; /* Center each card */
        border-radius: 12px;
        border: 1px solid #e0e0e0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    #equation-list li:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    }

    hr {
        margin: 30px 0; /* Add more spacing above and below dividers */
        border: none;
        border-top: 1px solid #ccc;
    }

    .secondary-tabs {
        display: flex;
        justify-content: center; /* Center the tabs horizontally */
        gap: 15px; /* Add spacing between tabs */
        margin-top: 10px; /* Add some margin above the tabs */
    }

    .menu-option {
        padding: 10px 20px;
        background-color: #ffffff;
        border: 1px solid #ccc;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .menu-option:hover {
        background-color: #e0e0e0;
    }

    .solve-popup {
        display: block;
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 500px;
        background: white;
        padding: 20px;
        border: 1px solid black;
        border-radius: 8px;
        box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    .solve-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .tab-button i {
        margin: 0;  /* Remove any margin to center the icon */
    }
    button:hover {
        background: #1e4dd8;
    }
        .popup-content input {
            padding: 10px;
            border-radius: 5px;
            border: 1px solid #ccc;
            font-family: 'Sora', sans-serif;
        }
    /* Add new button animations here */
    button {
        transition: background-color 0.3s ease, transform 0.2s ease;
    }
    button:hover {
        transform: translateY(-.8px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .full-width-input {
        width: 80%;
        max-width: 500px;
        padding: 10px;
        border-radius: 5px;
        border: 1px solid #ccc;
        display: block;
        margin: 0 auto 15px auto;
        box-sizing: border-box;
    }
    .blurred {
        filter: blur(4px);
        pointer-events: none;
        user-select: none;
    }

    /* Dropdown Menu Styles */
    #dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    width: 240px;
    z-index: 1000;
}

#dropdown-menu a, #dropdown-menu div {
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

#dropdown-menu a:last-child {
    border-bottom: none;
}

#dropdown-menu a:hover {
    background-color: #f7f7f7;
    cursor: pointer;
}

#dropdown-menu a i {
    margin-right: 15px;
    color: #5c5c5c;
    font-size: 1.2rem;
}

#dropdown-menu div {
    font-weight: bold;
    color: #4A4A4A;
    border-bottom: 2px solid #dedede;
}
    
        .variable-row {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .variable-row input {
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-family: 'Sora', sans-serif;
            font-size: 11px;
            flex: 1;
        }

    /* Toolbox Menu Styles */
    #toolbox-menu {
        padding: 10px 0;
        background-color: #ffffff;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
    }

    .menu-option {
        padding: 10px 20px;
        background-color: #ffffff;
        border: none;
        color: #000000;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .menu-option:hover {
        background-color: #e0e0e0;
    }
    
        .tab-button.active, .menu-option.active {
            background-color: #ccc; /* Consistent background color for all active tabs */
            color: #000000; /* Consistent text color for better visibility */
        }

/*announcement bar*/
                        #announcement-banner {
                position: fixed;
                top: 7px;
                left: 50%;
                transform: translateX(-50%);
                z-index: 999;
                font-size: 15px;
                background: #000000;
                color: white;
                padding: 5px 15px; /* Reduced vertical padding */
                border-radius: 5px; /* Optional for rounded corners */
                display: flex; /* Use flexbox for alignment */
                align-items: center; /* Vertically center content */
                justify-content: space-between; /* Space between text and close button */
                max-width: 90%; /* Optional: Limit the banner width */
            }
            #announcement-banner button {
                border: none;
                background-color: transparent;
                color: white;
                font-size: 20px;
                cursor: pointer;
                margin-left: 10px; /* Add spacing between text and button */
                align-self: flex-start; /* Ensure the button aligns with the top of the banner */
            }

            .tab-button {
                position: relative;
                padding: 12px 16px;
                opacity: 0.7;
                transition: all 0.2s ease;
              }
              
              .tab-button.active {
                opacity: 1;
                font-weight: 600;
              }
              
              .tab-button.active::after {
                content: '';
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 3px;
                background-color: #000;
                border-radius: 3px 3px 0 0;
              }
              
              .menu-option {
                position: relative;
                overflow: hidden;
              }
              
              .menu-option.active::before {
                content: '';
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: 4px;
                background-color: #000;
              }

              @media (max-width: 600px) {
                /* Ensure no horizontal scrolling */
                body {
                    overflow-x: hidden !important;
                    margin: 0 !important;
                    padding: 0 !important;
                }
            
                /* Adjust equation list for mobile */
                #equation-list {
                    display: grid !important;
                    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; /* Responsive grid */
                    gap: 12px !important;
                    padding: 10px !important;
                    margin: 0 auto !important; /* Center the list */
                }
            
                #equation-list li {
                    width: 100% !important; /* Ensure cards fit within the viewport */
                    max-width: 200px !important;
                    margin: 0 auto !important; /* Center cards */
                }
            
                /* Center and constrain navbar */
                header nav {
                    max-width: 100% !important;
                    margin: 0 auto !important;
                    padding: 8px 10px !important;
                    justify-content: space-between !important;
                }
            
                /* Stack text and action vertically */
                .content-container {
                    display: flex !important;
                    flex-direction: column !important;
                    align-items: center !important;
                    padding: 0 15px !important; /* Adjust padding for smaller screens */
                }
            
                .text-container {
                    margin: 20px 0 !important;
                    width: 100% !important;
                    text-align: center !important;
                }
            
                /* Adjust buttons for mobile */
                .button, .button2 {
                    width: 100% !important;
                    max-width: 300px !important;
                    margin: 10px auto !important;
                }
            
                /* Adjust secondary tabs for mobile */
                .secondary-tabs {
                    display: flex !important;
                    justify-content: center !important;
                    flex-wrap: wrap !important; /* Allow wrapping if needed */
                    gap: 10px !important;
                    padding: 10px 0 !important;
                }
            
                /* Adjust popups for mobile */
                .popup {
                    width: 90% !important;
                    max-width: 400px !important;
                    padding: 15px !important;
                }
            
                .popup-content {
                    gap: 10px !important;
                }
            
                /* Adjust announcement banner */
                #announcement-banner {
                    max-width: 90% !important;
                    font-size: 14px !important;
                    padding: 8px 10px !important;
                }
            
                /* Adjust footer for mobile */
                footer {
                    padding: 10px !important;
                    font-size: 0.8rem !important;
                }
            }

/* Center logo by default */
nav {
    display: flex;
    align-items: center;
    justify-content: center; /* Center logo by default */
    padding: 15px 20px;
    background: #ffffff;
    position: relative; /* Ensure child elements like profile-container are positioned correctly */
}

/* Space out logo and profile container when signed in */
nav.space-between {
    justify-content: space-between; /* Space out logo and profile container */
}

/* Ensure profile container is hidden when not needed */
#profile-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: absolute; /* Position it to the right without affecting logo centering */
    right: 20px; /* Adjust spacing from the right edge */
}

/* Hide profile container when not needed */
#profile-container[style*="display: none"] {
    display: none !important;
}

/* Profile dropdown menu styles */
#dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
    width: 240px;
    z-index: 1000;
}

#dropdown-menu div {
    padding: 10px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: #4A4A4A;
    border-bottom: 1px solid #f0f0f0;
}

#dropdown-menu div img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}
