/* ///////////////////////////////////////////////// */
/* ///////////General Page Structure/////////////// */
/* ///////////////////////////////////////////////// */

html, body {
    font-family: 'Wix Madefor Display', sans-serif;
    text-align: center;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Main content container */
.main-content {
    position: relative;
    width: 100vw;
    overflow-x: hidden;
}

.flex-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
}

.flex-end{
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.flex-row{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.space-between{
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.page-title-container{
    display: flex;
    flex-direction: column;
    justify-content: top;
}

.page-title{
    font-size: 32px;
    font-weight: 400;
    text-align: left;
    margin-top: 0;
    color: #323535;
}

.page-subtitle{
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    margin-top: 0;
    color: #323535;
}

/* Top nav */
.top-nav {
    background-color: white;
    padding: 24px 2vw;
    z-index: 10;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.05);
    width: 96vw;
    display: flex;
    align-items: top;
    justify-content: space-between;
}

.card-counter {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background-color: #323535;
    color: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    font-weight: bold;
}

/* Keep footer unstyled */
.built {
    color: #323535;
    font-size: 14px;
    font-weight: medium;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 96vw;
    margin: 20px 2vw;
    gap: 8px;
}

/* ///////////////////////////////////////////////// */
/* ///////////Login /////////////// */
/* ///////////////////////////////////////////////// */

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

/* Modal content styling */
.login-modal-content {
    background-color: #FFFFFF;
    margin: 15% auto;
    border: 1px solid #707070;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    text-align: left;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
}

.login-psswd{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 18px;
    color: #707070;
    margin-right: 24px;
    height: 40px;
    flex-grow: 1;
}

/* Login banner styling */
#loginBanner {
    display: none;
    width: 100vw;
    padding: 16px;
    text-align: center;
    font-family: 'Wix Madefor Display', sans-serif;
    font-size: 16px;
    color: white;
    background-color: #323535;
    z-index: 20;
}

/* Add this to your main.css file */
.login-banner-link {
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
}

.login-banner-link:hover {
    text-decoration: none; /* Optional: Remove underline on hover */
}

/* ///////////////////////////////////////////////// */
/* ///////////Main Page Buttons/////////////// */
/* ///////////////////////////////////////////////// */
.main-buttons-shell {
    display: flex;
    align-items: top;
    margin-top: 8px;
}

.invert-btn {
    display: flex;
    align-items: center;
    height: 36px;
    color: white;
    background-color: #323535;
    border: 2px solid #323535;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 16px;
    padding: 0 16px;
}

.invert-btn:hover {
    background-color: black;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.invert-btn .material-symbols-outlined {
    margin-right: 8px;
    font-size: 18px;
}

.login-btn{
    display: flex;
    align-items: center;
    height: 36px;
    background-color: white;
    color: #323535;
    border: 2px solid #323535;
    border-radius: 5px;
    cursor: pointer;
}

.login-btn:hover {
    color: white;
    background-color: black;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.icon-button-16{
    margin: 0px 8px 0 16px;
    font-size: 16px;
}

/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: white;
    color: #323535;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #323535;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    top: 75%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.1s;
    font-size: 75%;
    margin-top: -4px;
}

/* Remove the margin-top since we're using transform */
.tooltip .tooltiptext {
    margin-top: 0;
}

/* Right-aligned tooltip (for login button) */
.tooltip-right .tooltiptext {
    right: auto; /* Reset right position */
    left: 100%;
    transform: translateX(-100%);
}

/* Show tooltip on hover */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ///////////Action Button Dropdowns/////////////// */

/* Divider between text and caret */
.divider {
    height: 100%;
    width: 1px;
    background-color: white;
    margin: 0 8px 0 16px;
}

/* Caret styling */
.caret-down {
    color: white;
    margin-right: 8px;
    transition: transform 0.1s ease-in-out;
    transform-origin: center;
}

.rotate-caret{
    transform: rotate(180deg);
    transition: transform 0.1s ease-in-out;
    transform-origin: center;
}

/* Ensure dropdown positions correctly */
.dropdown-action {
    position: relative;
    display: inline-block;
    margin-right: 16px;
}

/* Dropdown Button */
.dropdown-action-btn {
    background-color: #323535;
    color: white;
    border: none;
    padding: 0;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 36px;
}

.dropdown-action-btn:hover {
    background-color: black;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}
/* Button text styles */
.dropdown-btn-text {
    font-size: 16px;
}


/* //////////Dropdown content /////////////*/

/* Hide dropdown content by default */
.dropdown-action-content {
    display: none; /* Ensures it's hidden initially */
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 6px 6px;
    padding: 10px;
    z-index: 1000;
    width: 105px;
}

/* Show dropdown when active */
.dropdown-action-active {
    display: block; /* Ensures it becomes visible */
}

/* Ensure dropdown is properly positioned */
.dropdown-action {
    position: relative;
    display: inline-block;
}

/* Style dropdown options */
.dropdown-action-content button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
}

/* Hover effect */
.dropdown-action-content button:hover {
    background: #f4f4f4;
}



/* ///////////////////////////////////////////////// */
/* //////////////////Card Grid Display/////////////// */
/* ///////////////////////////////////////////////// */


/* Tag group styles */
.tag-group {
    margin: 0;
    padding: 24px 0;
    display: flex;
    flex-direction: row;
    border-bottom: 2px solid #ececec;
}

/* Add this style for the last tag group to remove the bottom border */
.tag-group:last-child {
    border-bottom: none;
}

/* Cards Container - Full-Width Grid */
.card-container {
    width: 96vw;
    margin: 4vw 2vw 2vw 2vw;
    padding-bottom: 24px;
}

/* Header section container */
.header-section {
    width: 24vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0px 16px 16px 0;
    margin-right: 24px;
}

.tag-group-header {
    text-align: left;
    font-size: 20px;
    font-weight: 600;
    color: #323535;
    margin-bottom: 0; /* Remove margin since we're using gap */
}

.tag-description {
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    color: #707070;
    margin: 0;
}

/* Grid for cards within each tag group */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 23vw);
    gap: 1.25vw;
    justify-content: left;
    align-items: center;
}

/* Card Wrapper */
.card-wrapper {
    width: 100%;
    height: 300px; /* Change back to 300px from 240px */
    aspect-ratio: 4 / 3;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform-origin: center;
}

/* Card */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
    transform-origin: center;
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform;
}

/* Flip Effect */
.card-wrapper:hover .card {
    transform: rotateY(180deg);
}

/* Front & Back Faces */
.card-front, .card-back {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: 16px;
    backface-visibility: hidden;
    background-color: white !important;
    border: 4px solid var(--law-color, #323535);
    color: black !important;
    transform-origin: center;
    padding: 24px;
    box-shadow: 
    4px 4px 8px rgba(0, 0, 0, 0.1),          /* Original shadow */
    inset 4px 3px 12px rgba(0, 0, 0, 0.1);  /* Inner shadow from top right */
}

/* Card Front */
.card-front {
    font-size: 18px;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 32px; /* Add space for the tag */
}

/* Card Back */
.card-back {
    transform: rotateY(180deg);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

/* Read More Button styling */
.read-more-btn {
    background-color: #323535;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    margin-top: auto;
}

.read-more-btn:hover {
    background-color: black;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.read-more-btn .material-symbols-outlined {
    margin-right: 8px;
    font-size: 14px;
}

.read-more-btn .dropdown-btn-text {
    font-size: 14px;
}

/* Tag Label */
.tag-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #323535;
    background-color: var(--law-color, #323535);
    border: none;
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 60px;
}




/* ///////////////////////////////////////////////// */
/* //////Modal Shells and Common Components/////////////// */
/* ///////////////////////////////////////////////// */
.modal-shell {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #FFFFFF;
    margin: 15% auto;
    /* padding: 20px; */
    border: 1px solid #707070;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    text-align: left;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    position: relative; /* Ensure the close button is positioned relative to the modal content */
}

.modal-header{
    font-family: 'Wix Madefor Display', sans-serif;
    text-align: left;
    font-size: 24px;
    font-weight: 400;
    margin: 0;
}

.modal-subheader{
    font-family: 'Wix Madefor Display', sans-serif;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

/* Close button styling */
.close {
    color: #323535;
    font-size: 32px !important;
    font-weight: 400;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
}

.close:hover, .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
    background-color: #ebebeb;
    border-radius: 8px;
}


.submit{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 16px;
    color: #FFFFFF;
    background-color: #323535;
    height: 40px;
    width: fit-content;
    min-width: 120px;
    padding: 0 16px;
    border-radius: 8px;
    cursor: pointer;
}

.submit:hover {
    background-color: black;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.dropdown-field{
    display: flex;
    flex-direction: row;
    width: fit-content;
    align-items: center;
    margin-bottom: 16px;
}



#addCardForm input, #addCardForm textarea, #addTagForm input, #addTagForm textarea {
    width: 95%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    border-radius: 8px;
}

#addCardForm, #addTagForm, #loginForm{
    padding: 20px;
}

.form-input{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 14px;
    color: #707070;
    margin-right: 8px;
}

.add-description{
    height: 96px
}

/* When a tag is marked for deletion */
.marked-for-deletion {
    opacity: 1;
    pointer-events: none; /* Prevents interaction with deleted tags */
}

/* Allow the Undo button to still be clickable */
.marked-for-deletion .delete-tag-btn {
    pointer-events: all;
    opacity: 1;
    font-weight: bold;
    color: red;
}

/* Empty state styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    color: #888;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* ///////////////////////////////////////////////// */
/* //////////////////Tag Modals/////////////// */
/* ///////////////////////////////////////////////// */
/* Tag Form Layout */
#tagList {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.add-new-text {
    cursor: pointer;
    margin-top: 24px;
    color: #323535;
    font-size: 16px;
}

.add-new-text:hover {
    text-decoration: underline;
}

/* Adjust the tag input widths */
.tag-input {
    display: flex;
    align-items: top;
    width: 100%;
    margin-bottom: 10px;
    gap: 24px;
    height: 96px;
}

.tag-input input[type="text"] {
    width: 30%; /* Reduce width of tag name input */
    min-width: 150px; /* Ensure minimum readable width */
    align-items: top;
}

.tag-definition-input {
    width: 40% !important; /* Make definition textarea narrower */
    min-height: 36px;
    resize: vertical;
}

.delete-tag-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.delete-tag-btn:hover {
    background-color: #ebebeb;
}

/* Style for the color container */
.color-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Color Dropdown */
.color-select {
    padding: 4px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
}

/* Small Color Preview Circle */
.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #aaa;
}


/* ///////////////////////////////////////////////// */
/* //////////////////Card Modals/////////////// */
/* ///////////////////////////////////////////////// */

.tag-dropdown{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 14px;
    color: #323535;
    font-weight: 600;
    height: 32px;
}

#descriptionInput{
    margin-bottom: 16px;
}

/* Adjust the modal dimensions and overflow */
.card-edit-modal {
    width: 85vw;
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 5% auto;
    padding: 0px; /* Add padding to the content area */
}

.tag-edit-modal{
    width: 64vw;
    height: fit-content;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 5% auto;
    padding: 0px; /* Add padding to the content area */
}


/* Modal body content styling */
.card-edit-modal-content {
    padding: 20px;
    overflow-y: auto; /* Make the content scrollable */
    flex: 1; /* Allow the content to grow and shrink */
}

#cardList{
    margin: 32px 0;
}

/* Align card-input fields and dropdown to the top */
.card-input {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.card-input textarea {
    flex-grow: 1; /* Ensure the description field fills the remaining width */
    height: 10vh; /* Set height to 10vh */
    min-height: 60px; /* Set minimum height to 60px */
}


/* Modal header styling */
.modal-header-container {
    background-color: white;
    position: sticky;
    top: 0; /* Ensure it stays at the top */
    width: calc(85vw - 40px); /* Adjust width to account for padding */ 
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    z-index: 10; /* Ensure it stays above the content */
    border-radius: 16px 16px 0 0px;
}

/* Modal footer styling */
.modal-footer {
    background-color: white;
    position: sticky;
    bottom: 0; /* Ensure it stays at the bottom */
    width: calc(85vw - 40px); /* Adjust width to account for padding */ 
    padding: 20px; /* Add padding to the footer */
    border-top: 1px solid #ddd;
    z-index: 10; /* Ensure it stays above the content */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-hf{
    width: calc(64vw - 40px);
}

.add-card-hf{
    width: calc(400px - 40px);
}

.login-hf{
    width: calc(400px - 40px);
}

/* ///////////////////////////////////////////////// */
/* ///////////////////Read More Modal/////////////// */
/* ///////////////////////////////////////////////// */

.read-more-modal{
    width: 85vw;
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 5% auto;
    padding: 0px; /* Add padding to the content area */
}

.read-more-modal-content{
    padding: 20px;
    overflow-y: auto; /* Make the content scrollable */
    flex: 1; /* Allow the content to grow and shrink */
}

.read-more-modal-tag{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 14px;
    color: #323535;
    font-weight: 600;
    height: 32px;
}

.read-more-btn{
    font-family: 'Wix Madefor Display', sans-serif;
    font-family: 14px;
    color: #FFFFFF;
    background-color: #323535;  
    font-weight: 600;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    position: absolute;
    bottom: 20px;
    right: 20px;
}

/* Read More Modal text columns */
.read-more-text-columns {
    column-gap: 40px;
    column-fill: auto;
    text-align: left;
    line-height: 1.6;
    padding: 0;
    overflow: hidden;
    height: fit-content;
}

.read-more-text-columns p:first-child {
    margin-top: 0;
    padding-top: 0;
}

.read-more-text-columns p {
    margin: 16px 0;
}

/* Desktop layout */
@media screen and (min-width: 769px) {
    .read-more-text-columns {
        column-count: 2;
        max-height: calc(6 * 1.6em); /* 6 lines initially */
        column-rule: 1px solid #eee;
    }

    /* When content overflows 6 lines */
    .read-more-text-columns.overflow {
        max-height: none;
        column-fill: balance;
    }
}

/* Mobile layout */
@media screen and (max-width: 768px) {
    .read-more-text-columns {
        column-count: 1;
        width: 100%;
        padding: 0 16px;
    }
}

/* Container for text columns and actions */
.read-more-container {
    display: flex;
    gap: 20px;
    height: fit-content;
}

/* Adjust text columns to fit with actions */
.read-more-text-columns {
    flex: 1;
    /* ... existing styles ... */
}

/* Actions column */
.read-more-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
    border-left: 1px solid #eee; /* Add left divider */
    padding-left: 20px; /* Add padding for the divider */
}

/* Additional Resources section */
.additional-resources-section {
    border-top: 1px solid #eee; /* Add top divider */
    margin-top: 24px;
    padding-top: 24px;
}

/* Primary and confirm actions containers */
.primary-actions, .confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Keep existing action buttons styles */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #323535;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #ebebeb;
}

/* Hide actions on mobile */
@media screen and (max-width: 768px) {
    .read-more-actions {
        display: none;
    }
}

/* Edit mode styles */
.read-more-text-columns.edit-mode {
    column-count: 1; /* Temporarily remove columns during edit */
}

.read-more-textarea {
    width: 95%;
    height: fit-content;
    min-height: 80px;   
    border: 1px solid #c3c3c3;
    border-radius: 8px;
    padding: 16px;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    resize: vertical;
    background: #fafafa;
}

.read-more-textarea:focus {
    outline: none;
    border-color: #323535;
    background: white;
}

.edit-btn{
    background-color: white;
    border-radius: 5px;
    color: #323535;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    background-color: #ebebeb;
}

/* Save button state */
.edit-btn[data-mode="save"] {
    color: #37d79f;
    border: 2px solid #37d79f;
    background-color: white;    
}

.edit-btn[data-mode="save"]:hover {
    color: #4bc7ad;
    border: 2px solid #4bc7ad;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

/* Prevent background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Delete button states */
.delete-btn {
    color: #323535;
    border: 2px solid transparent;
    background-color: white;
    border-radius: 5px;
}

.delete-btn:hover {
    color: black;
    cursor: pointer;
    background-color: #ebebeb;
}

/* Delete confirmation state */
.confirm-btn {
    color: #ff4d4d;
    border: 2px solid #ff4d4d;
    background-color: white;
}

.confirm-btn:hover {
    color: #ff3333;
    border: 2px solid #ff3333;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

/* Undo button styles */
.undo-btn {
    color: #323535;
    border: 2px solid #323535;
    background-color: white;
    border-radius: 5px;
}

.undo-btn:hover {
    color: black;
    border: 2px solid black;
    background-color: white;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

/* Add specific styles for action button tooltips */
.read-more-actions .tooltip .tooltiptext {
    top: 50%;
    right: calc(100% + 8px);
    left: auto;
    transform: translateY(-50%);
}

.edit-trigger{
    text-decoration: underline;
    cursor: pointer;
    color: #323535;
    font-weight: 600;
}



/* URL list styles */
#urlsList {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-top: 16px;
}

/* URL item styles */
.url-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.url-link {
    color: #323535;
    text-decoration: underline;
    flex: 1;
}

.delete-url-btn-container {
   border-left: 1px solid #eee; /* Add left divider */
   padding-left: 20px; /* Add padding for the divider */
}

.delete-url-btn {
    display: flex;           /* Match action-btn styles */
    align-items: center;
    justify-content: center;
    width: 36px;            /* Match action-btn dimensions */
    height: 36px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: white;
    color: #323535;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-url-btn.confirm {
    color: #ff4d4d;
    border: 2px solid #ff4d4d;
}

.delete-url-btn:hover {
    background-color: #ebebeb;
}

.delete-url-btn.confirm:hover {
    color: #ff3333;
    border: 2px solid #ff3333;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.add-new-url{
    cursor: pointer;
    margin-top: 24px;
    color: #323535;
    font-size: 16px;
}

/* Add URL input styles */
.url-input {
    font-family: inherit;
    font-size: inherit;
    color: #323535;
}

.url-input:focus {
    outline: none;
    border-color: #323535 !important;
}

/* Add styles for the definition textarea in tag edit modal */
.tag-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.tag-row:last-child {
    border-bottom: none;
}

.tag-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Tag section header styles */
.tag-section-header {
    width: 100%;
    text-align: left;
    padding: 12px;
    margin: 16px 0 12px 0;
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid #323535;
    background-color: #f8f8f8 !important;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 18px;
    color: #323535;
    padding: 8px;
}

.info-icon {
    font-size: 24px !important;
    color: #323535;
    cursor: help;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.info-icon:hover {
    background-color: rgba(0,0,0,0.1);
}

/* Tooltip styles */
.tag-section-header .tooltip {
    visibility: hidden;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #323535;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: max-content;
    max-width: 300px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.tag-section-header:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Add arrow to tooltip */
.tag-section-header .tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #323535 transparent;
}

/* Search button states */
.search-expanded {
    width: 16vw !important;
    background-color: white !important;
    border: 1px solid #323535 !important;
    color: #323535 !important;
    transition: all 0.2s ease-in-out;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
}

/* Search input styling */
.search-input {
    display: none; /* Hidden by default */
    border: none;
    background: none;
    width: 100%;
    margin-left: 8px;
    font-family: 'Wix Madefor Display', sans-serif;
    font-size: 16px;
    color: #323535;
    outline: none;
    padding: 4px 0;
}

.search-input::placeholder {
    color: #707070;
    font-weight: 400;
}

/* Show input when expanded */
.search-expanded .search-input {
    display: block;
}

/* Search Results Modal */
.search-results-modal {
    width: 80vw;
    height: fit-content;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 5% auto;
    padding: 0;
}

.search-hf {
    width: calc(80vw - 40px);
}

.search-results-list {
    padding: 20px;
    padding-bottom: 40px; /* Add extra padding at the bottom */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-result-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s ease-in-out;
}

.search-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Update header area to use flex */
.search-result-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.search-result-tag {
    align-self: flex-end;
    font-size: 12px;
    font-weight: 600;
    color: #323535;
    padding: 4px 12px;
    border: 2px solid;
    border-radius: 16px;
    margin-bottom: 8px;
}

.search-result-title {
    font-size: 18px;
    font-weight: 600;
    color: #323535;
    align-self: flex-start;
    width: 100%;
}

.search-result-description {
    font-size: 14px;
    color: #707070;
    line-height: 1.4;
}

/* Search match highlighting */
.search-match {
    color: #ff4d4d;
    font-weight: 600;
}

/* Search Side Sheet */
.search-side-sheet {
    position: fixed;
    top: 0;
    right: -32vw;
    width: 32vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.search-side-sheet.open {
    right: 0;
}

.side-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.search-results-list {
    flex: 1; /* Take up remaining space */
    padding: 20px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto; /* Enable scrolling */
}

/* Add body class for when drawer is open */
body.drawer-open {
    overflow: hidden !important;
    padding-right: 15px; /* Prevent layout shift when scrollbar disappears */
}

/* Scrim for search drawer */
.search-scrim {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
}

.search-scrim.open {
    opacity: 1;
    visibility: visible;
}

/* Search result card hover and highlight */
.search-result-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s ease-in-out;
}

.search-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Highlight animation for target card */
@keyframes highlightCard {
    0% { 
        border-radius: 8px;
        transform: scale(1);
    }
    100% { 
        border-radius: 16px;
        transform: scale(1.02);
    }
}

.card-highlight {
    position: relative;
    animation: highlightCard 0.3s ease-in-out forwards 0.2s,
               highlightCard 0.3s ease-in-out reverse forwards 1.1s;
}

/* Highlight scrim */
.highlight-scrim {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}

.highlight-scrim.show {
    opacity: 1;
    visibility: visible;
}