:root {
    --primary: #3AAFA9;
    --secondary: #2B7A78;
    --light: #DEF2F1;
    --white: #FEFFFF;
    --dark: #17252A;
    --error: #e63946;
    --success: #2ecc71;
}
body {
   font-family: "Segoe UI", sans-serif;
   background-color: var(--light);
   margin: 0;
   display: flex;
   justify-content: center;
}
.main-wrapper {
   width: 100%;
   max-width: 800px;
   padding: 20px;
}
nav {
   background: var(--dark);
   color: var(--white);
   padding: 15px 25px;
   border-radius: 12px;
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 25px;
}
.user-info {
   display: flex;
   align-items: center;
   gap: 10px;
}
.avatar {
   width: 32px;
   height: 32px;
   background: var(--primary);
   color: var(--dark);
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: bold;
}
.nav-links {
   display: flex;
   align-items: center;
}
.nav-links a {
   color: var(--primary);
   text-decoration: none;
   margin-left: 15px;
   font-size: 0.9em;
   transition: 0.3s;
}
.nav-links a:hover {
   color: var(--white);
}
.nav-links .active-link {
   color: var(--white);
   margin-left: 15px;
   font-size: 0.9em;
   font-weight: bold;
   cursor: default;
}
.search-box {
   background: var(--white);
   padding: 40px;
   border-radius: 12px;
   text-align: center;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
   margin-bottom: 25px;
}
.search-form {
   display: flex;
   gap: 10px;
}
input[type="text"] {
   flex: 1;
   padding: 12px;
   border: 2px solid var(--light);
   border-radius: 8px;
   outline: none;
}
button {
   background: var(--secondary);
   color: var(--white);
   border: none;
   padding: 12px 25px;
   border-radius: 8px;
   cursor: pointer;
   font-weight: bold;
}
.ad-card {
   background: var(--white);
   padding: 20px;
   margin-bottom: 15px;
   border-radius: 12px;
   display: flex;
   gap: 20px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.ad-image {
   width: 120px;
   height: 120px;
   object-fit: cover;
   border-radius: 8px;
}
.price {
   color: #2d7a2d;
   font-weight: bold;
}
.error {
   color: #e63946;
   text-align: center;
   margin-bottom: 15px;
   font-weight: bold;
}
.image-container {
   position: relative;
   width: 120px;
   height: 120px;
}
.action-btn,
.search-form button {
   background-color: var(--primary);
   color: var(--dark);
   padding: 12px 24px; /* Adjust to match your Search button padding */
   border-radius: 8px;
   border: none;
   font-size: 14px;
   font-weight: bold;
   cursor: pointer;
   text-decoration: none; /* Removes underline from the link */
   display: inline-flex;
   align-items: center;
   justify-content: center;
   transition: background 0.3s ease;
   height: 46px; /* Match height so they align perfectly on one row */
   box-sizing: border-box;
}
.action-btn:hover,
.search-form button:hover {
   background-color: var(--secondary);
   color: white;
}
.new-badge {
   position: absolute;
   top: -10px;
   left: -10px;
   background: #2d7a2d;
   color: white;
   font-weight: bold;
   font-size: 10px;
   padding: 8px 5px;
   border-radius: 50%;
   border: 2px solid white;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
   z-index: 10;
   text-align: center;
   line-height: 1;
}
.btn-primary-action {
   background-color: var(--primary);
   color: var(--dark);
   padding: 10px 20px;
   border-radius: 8px;
   text-decoration: none;
   font-weight: bold;
   display: inline-block;
   transition: background 0.3s;
   border: none;
   cursor: pointer;
}
.btn-primary-action:hover {
   background-color: var(--secondary);
   color: white;
}
.container {
   width: 95%; /* Take up almost the full width on small screens */
   max-width: 1200px; /* But don't get too wide on a desktop */
   margin: 0 auto; /* Keep it centered */
}
.nav-links a {
   color: var(--primary);
   text-decoration: none;
   margin-left: 15px;
   font-size: 0.9em;
}
.nav-links .active-link {
   color: var(--white);
   margin-left: 15px;
   font-size: 0.9em;
   font-weight: bold;
}
.history-card {
   background: var(--white);
   padding: 30px;
   border-radius: 12px;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.btn {
   padding: 8px 5px;
   border-radius: 6px;
   cursor: pointer;
   border: none;
   font-weight: bold;
   font-size: 0.85em;
}
.btn-clear {
    background-color: transparent;
    color: #e63946;
    border: 1px solid #e63946;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-clear:hover {
    background-color: #e63946;
    color: white;
}
.btn-schedule {
   background: var(--primary);
   color: var(--dark);
}

.pagination-controls {
   margin-top: 20px;
   display: flex;
   justify-content: space-between;
   align-items: center;
}
.search-link {
   color: var(--secondary);
   text-decoration: none;
   font-weight: bold;
}
.search-link:hover {
   text-decoration: underline;
}
.profile-card {
   background: var(--white);
   padding: 40px;
   border-radius: 12px;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
   text-align: center;
}
input {
   width: 100%;
   padding: 12px;
   margin: 10px 0;
   border: 2px solid var(--light);
   border-radius: 8px;
   box-sizing: border-box;
}
.tab-container {
   display: flex;
   gap: 20px;
   border-bottom: 2px solid var(--light);
   margin-bottom: 20px;
}
.tab {
   padding: 10px 20px;
   cursor: pointer;
   color: var(--secondary);
   text-decoration: none;
   font-weight: bold;
}
.tab.active {
   border-bottom: 3px solid var(--primary);
   color: var(--dark);
}
.btn-add {
   background: var(--primary);
   color: var(--dark);
   padding: 8px 15px;
   border-radius: 6px;
   text-decoration: none;
   float: right;
   font-size: 0.8em;
}
.admin-card {
   background: var(--white);
   padding: 30px;
   border-radius: 12px;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
table {
   width: 100%;
   border-collapse: collapse;
   margin-top: 20px;
}
th {
    text-align: center;

}
td {
   text-align: center;
   padding: 15px 12px;
   border-bottom: 1px solid var(--light);
}
.status-badge {
   font-weight: bold;
}
.btn-delete {
   color: #e63946;
   background: none;
   border: 1px solid #e63946;
   padding: 5px 12px;
   border-radius: 6px;
   cursor: pointer;
}
/* Force Buttons and Links to behave exactly the same */
.btn-primary-action, button.btn-primary-action, a.btn-primary-action {
    display: inline-flex !important; /* Forces icon and text to stay on one line */
    align-items: center;
    justify-content: center;
    gap: 8px;           /* Adds perfect spacing between the emoji and text */
    height: 48px;       /* Hard-coded height so they match regardless of content */
    padding: 0 20px;    /* Horizontal padding only */
    box-sizing: border-box !important;
    text-decoration: none;
    border: none;
}

/* Ensure the icon doesn't shift the text height */
.btn-primary-action span {
    display: flex;
    align-items: center;
}
/* New wrapper logic */
.password-wrapper { 
    position: relative; 
    width: 100%; 
    display: flex; 
    align-items: center; /* Vertically centers everything inside */
}

.password-wrapper input {
    padding-right: 45px; /* Make room so text doesn't go under the icon */
    margin: 8px 0;
}

/* The Icon Button */
.icon-btn { 
    position: absolute; 
    right: 12px; 
    /* Centers icon vertically regardless of input height */
    top: 50%;
    transform: translateY(-50%); 
    
    cursor: pointer; 
    color: #888; 
    border: none !important; 
    background: none !important; 
    padding: 0 !important; 
    margin: 0 !important;
    width: auto !important;
    box-shadow: none !important;
    outline: none !important;
    z-index: 10;
}

/* Disable hover effects for the icon button */
.icon-btn:hover, .icon-btn:active, .icon-btn:focus {
    background: none !important;
    color: #555; /* Slight color change instead of a background block */
    box-shadow: none !important;
    transform: translateY(-50%) scale(1.1); /* Subtle scale instead of "button" hover */
}

/* Matching checkmark positioned just to the left of the eye icon */
.match-check { 
    position: absolute; 
    right: 40px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #2ecc71; 
    display: none; 
    z-index: 5;
}
.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}
.card { 
    background: var(--white); 
    padding: 40px; 
    border-radius: 12px; 
    width: 100%;
    max-width: 400px; 
    text-align: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}
label { font-size: 0.9em; font-weight: bold; display: block; text-align: left; margin-top: 10px; }
button.btn-primary:hover { background-color: #1a5e5c; }
input, select, textarea { 
    width: 100%; 
    padding: 12px; 
    margin: 8px 0; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    box-sizing: border-box; 
}

button.btn-primary { 
    width: 100%; 
    padding: 12px; 
    background-color: var(--secondary); 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold;
    margin-top: 10px;
}
.search-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap; /* Keeps it on one line on desktop */
}

.button-group {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.save-btn {
    background-color: var(--secondary) !important;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.input-group {
    flex: 1; /* All elements start with equal base width */
}

/* Specific rule to make the 'What are you looking for?' box wider */
.main-query {
    flex: 2; 
}

/* Unified style for BOTH <button> and <a> */
.search-btn {
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;            /* Fixed height for both */
    min-width: 120px;
    padding: 0 24px;         /* Uniform horizontal padding */
    
    /* Typography */
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;        /* Strong bold like your image */
    text-decoration: none;   /* Removes link underline */
    
    /* Visuals */
    border: none;
    border-radius: 10px;     /* Smooth rounded corners from your image */
    cursor: pointer;
    box-sizing: border-box;  /* Critical for identical sizing */
    transition: all 0.2s ease;
}

/* Matching the teal color from your screenshot */
.search-btn {
    background-color: #64b2ac; /* Primary teal */
    color: #17252A;
}

/* Matching the darker teal for the Save button */
.save-btn {
    background-color: #467a75 !important; /* Darker teal */
    color: #ffffff !important;
}

.search-btn:hover {
    filter: brightness(90%);
    transform: translateY(-1px);
}
.no-results-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.no-results-icon {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.6;
}

.no-results-container h2 {
    color: var(--dark);
    margin-bottom: 10px;
}

.no-results-container p {
    color: #666;
    max-width: 400px;
    margin: 0 auto 20px auto;
    line-height: 1.5;
}
/* Ensure nav can wrap its content on mobile */
nav {
    position: relative;
    flex-wrap: wrap;
}

/* The button container */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    gap: 5px; /* Spacing between the lines */
    width: 40px;
    height: 40px;
    align-items: center;
}

/* Individual lines */
.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary); /* Uses your teal color */
    border-radius: 3px;
    transition: 0.3s ease; /* Makes it smooth if you decide to animate later */
}
/* This forces the Avatar and Hamburger to always be side-by-side */
.nav-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}












.details-row {
    background-color: #fcfcfc !important;
}

.details-inner-container {
    display: flex;
    justify-content: flex-start; /* Space items from the left */
    align-items: center;
    gap: 50px;                   /* Large gap between items on desktop */
    padding: 20px 20px 20px 60px; /* Deep indent to align under search term */
    border-bottom: 2px solid #f0f0f0;
    animation: fadeIn 0.3s ease;  /* Smooth appearance */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-item {
    display: flex;
    flex-direction: column;      /* Label on top, value on bottom */
    min-width: 100px;            /* Ensures items don't squash */
}

.detail-label {
    font-weight: 700;
    font-size: 0.7rem;           /* Small, tidy labels */
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* Optional: Add a subtle left border to the info block */
.details-inner-container {
    border-left: 4px solid var(--primary, #2b7a78); 
    margin: 10px 0 10px 42px; /* Pull it slightly away from edges */
    border-radius: 4px;
}
/* --- COMBINED RESPONSIVE LOGIC --- */

/* 1. Triggers for Tablets and Large Phones (850px and down) */
@media (max-width: 850px) {
    /* FIX: Keep Nav at a constant height so it doesn't expand */
    nav {
        display: flex !important;
        flex-direction: row !important; 
        flex-wrap: nowrap !important;    
        justify-content: space-between !important;
        align-items: center !important;
        height: 65px; /* Hard limit on height */
        position: relative;
        z-index: 1000;
        padding: 0 15px !important;
    }

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

    .user-info {
        display: flex;
        align-items: center;
    }

    .menu-toggle {
        display: flex !important; 
    }

    /* FIX: Absolute positioning makes the menu "float" over the page */
    .nav-links {
        display: none; 
        position: absolute;
        top: 65px; /* Starts right at the bottom of the nav bar */
        left: 0;
        width: 100%; 
        flex-direction: column;
        background: var(--dark);
        border-top: 1px solid var(--secondary);
        box-shadow: 0 10px 15px rgba(0,0,0,0.2);
        z-index: 999;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links a, .nav-links .active-link {
        margin: 0 !important;
        padding: 15px 25px !important;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        box-sizing: border-box;
    }

    .language-selector {
        padding: 15px 25px;
        justify-content: flex-start !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* KEEPING YOUR SEARCH FORM FIXES */
    .search-form-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100%;
    }

    .search-form-container .input-group,
    .search-form-container .main-query {
        width: 100% !important;
        flex: none !important;
    }

    .search-form-container div[onclick="toggleAdvancedFilters()"] {
        width: 100% !important;
        height: 45px !important;
    }

    .search-form-container input,
    .search-form-container select {
        width: 100% !important;
        height: 45px !important;
    }
}

/* 2. Triggers for Standard Mobile (768px and down) */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }

    .card-container, .card {
        overflow-x: hidden !important;
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* --- TABLE TO CARD TRANSFORMATION --- */
    .hide-on-mobile { display: none !important; }

    .saved-searches-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .saved-searches-table tbody, 
    .saved-searches-table tr.mobile-card {
        display: block !important;
        width: 100% !important;
    }

    .saved-searches-table tr.mobile-card {
        margin-bottom: 15px !important;
        border: 1px solid #ddd !important;
        border-radius: 10px !important;
        background: #fff !important;
        padding: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
        position: relative !important;
        box-sizing: border-box !important;
    }

    .saved-searches-table td[data-label] {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 5px !important;
        border: none !important;
        border-bottom: 1px solid #f4f4f4 !important;
    }

    .saved-searches-table td[data-label]::before {
        content: attr(data-label);
        font-weight: bold;
        color: #666;
        font-size: 0.85em;
    }

    .toggle-cell {
        position: absolute !important;
        top: 15px !important;
        right: 10px !important;
        width: 30px !important;
        border: none !important;
        padding: 0 !important;
    }

    /* --- CLEANER EXPANDED FILTERS --- */
    .details-row { display: none; width: 100% !important; }

    .details-row td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
    }

    .details-inner-container {
        display: block !important;
        padding: 10px 15px !important;
        margin: 0 !important;
        border-left: none !important;
        background-color: #fafafa !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .detail-item {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #eee !important;
    }

    .detail-label {
        font-size: 0.85rem !important;
        text-transform: none !important;
        margin-bottom: 0 !important;
    }
}

