:root {
    /* New Blue Palette */
    --bg-dark: #072C8C;     /* Deep Blue Background */
    --bg-card: rgba(7, 44, 140, 0.6);
    --primary: #00a1df;     /* Vivid Cyan Blue */
    --mid-blue: #007FD1;
    --highlight: #86C5D8;   /* Pale Blue */
    
    --text-main: #ffffff;
    --text-muted: #86C5D8;  /* Using Pale Blue for muted text */
    --border: rgba(134, 197, 216, 0.2); /* Pale blue border */
    
    /* Radius adjusted to 3px everywhere */
    --radius-lg: 3px;
    --radius-md: 3px;
    --radius-sm: 3px;
    
    --container-max: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color:#1a2b88f7;
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    /* Lighter Gradient Background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 161, 223, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(134, 197, 216, 0.15) 0%, transparent 40%);
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px 20px;
}

.logo-area {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.main-logo {
    max-width: 350px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 161, 223, 0.3));
}

.subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 10px;
    background: linear-gradient(to right, #d500ff, #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

/* Search Bar (Colorlib Search-23 inspired; no background) */
.search-container {
    max-width: 790px;
    margin: 0 auto 30px;
    position: relative;
}

/* Wrapper */
.cm-search {
    font-family: 'Poppins', sans-serif;
}

/* Form layout (scoped so it won't touch the rest of the page) */
.cm-search form {
    width: 100%;
}

.cm-search .inner-form {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.25);
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 0;
}

.cm-search .input-field {
    height: 58px;
}

.cm-search .input-field input {
    height: 100%;
    background: transparent;
    border: 0;
    display: block;
    width: 100%;
    padding: 10px 48px 10px 0;
    font-size: 18px;
    color: #000;
}

.cm-search .input-field input::placeholder {
    color: #525050; /* light grey */
    opacity: 1;  /* ensures consistent color across browsers */
}


.cm-search .input-field input:hover,
.cm-search .input-field input:focus {
    box-shadow: none;
    outline: 0;
}

/* Left side (icon + input) */
.cm-search .input-field.first-wrap {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: #b8f6f9;
    position: relative;
}

.cm-search .input-field.first-wrap .svg-wrapper {
    min-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cm-search .input-field.first-wrap svg {
    width: 32px;
    height: 32px;
    fill: #383737;
}

/* Clear button (matches behavior from page 1) */
.cm-search .cm-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 0;
    background: rgba(0, 0, 0, 0.08);
    color: #222;
    cursor: pointer;
    display: none; /* toggled by script.js */
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
}

.cm-search .cm-clear-btn:hover {
    background: rgba(0, 0, 0, 0.14);
}

.cm-search .cm-clear-btn:focus {
    outline: 0;
    box-shadow: none;
}

/* Right side (search button) */
.cm-search .input-field.second-wrap {
    min-width: 216px;
}

.cm-search .input-field.second-wrap .btn-search {
    height: 100%;
    width: 100%;
    white-space: nowrap;
    font-size: 16px;
    color: #fff;
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 0;
    background: #398fdf;
    transition: all .2s ease-out, color .2s ease-out;
    font-weight: 300;
}

.cm-search .input-field.second-wrap .btn-search:hover {
    background: #4876bb;
}

.cm-search .input-field.second-wrap .btn-search:focus {
    outline: 0;
    box-shadow: none;
}

/* Responsive tweaks (from the template) */
@media screen and (max-width: 992px) {
    .cm-search .input-field {
        height: 50px;
    }
}

@media screen and (max-width: 767px) {
    .cm-search .input-field.first-wrap .svg-wrapper {
        min-width: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 10px;
    }
    .cm-search .input-field.first-wrap svg {
        width: 26px;
        height: 26px;
        fill: #222;
    }
    .cm-search .input-field.second-wrap {
        min-width: 100px;
    }
    .cm-search .input-field.second-wrap .btn-search {
        font-size: 13px;
    }

}


.cm-search .input-field input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.cm-search .input-field input::-ms-clear {
    display: none;
}

.cm-search .input-field input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}



/* Controls */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 5px;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.sort-select {
    background: rgba(0, 127, 209, 0.2);
    color: white;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}
.sort-select option {
    background: var(--bg-dark);
}


.sort-select {
    display: none !important;
}


/* Grid & Cards */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

/* --- FIXED CARD + IMAGE BEHAVIOR --- */

.phone-card {
    /* background-color: rgba(57, 95, 165, 0.726); orig. */

    background: rgba(32, 47, 90, 0.7); /* Blue-gray, darker for texts */
    /* border-left: 3px solid rgba(0, 161, 223, 0.5); left accent */

    border-radius: 12px;
    overflow: hidden; /* CRITICAL: clips image to rounded corners */
    padding: 0; /* remove padding so image can touch edges */
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.phone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--primary);
    /* background: rgba(255, 255, 255, 0.05); --orgin */
    background: rgba(42, 57, 100, 0.8); /* hover for Blue-gray */    
}

/* Update card-image-container to position relative */
.card-image-container {
    position: relative;
    height: 200px;
    padding: 0;
    background: radial-gradient(circle, rgba(134, 197, 216, 0.44), rgba(60, 148, 149, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Image fills the container edge-to-edge */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ensures full bleed */
    display: block; /* removes inline gaps */
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3));
}

/* Keep your existing content padding */
.card-content {
    position: relative; /* helps to position top20 badge */
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.image-placeholder {
    color: var(--highlight);
    font-size: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
}

.image-placeholder span { font-size: 0.8rem; letter-spacing: 1px; }

.phone-brand {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.phone-model {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
}

/* // transitioned to tiktok style
.phone-blurb {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
*/

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.year-badge, .manual-link, .feature-badge {
    font-size: 0.85rem;
    color: white;
    background: var(--mid-blue);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    padding: 10px;
}
.manual-link {
    text-decoration: none;
}
.manual-link i {
  color: inherit;              /* icon follows default text color */
  transition: color 0.2s ease; /* smooth hover */
}
.manual-link:hover i {
  color: #dc2626; /* red (Tailwind red-600 style) */
}

p.uppercase {
    text-transform: uppercase;
}

.view-details-btn {
    background: #54bd7a69;
    color: white;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.learn-more-btn {
    background: #54bd7a69;
    color: white;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;    
    transition: color 0.3s ease;
    transition: padding 0.2s ease, background 0.2s ease; /* animate padding smoothly */    
}

.learn-more-btn i {
    transition: color 0.3s ease;    
}
.learn-more-btn:hover i {
    /*color: #1d4ed8; */ /* text + icon changes color */
    /*transform: translateX(5px); */
    color: #6ea5c7;
}


.view-details-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.flex-inline {
    display: flex;
    align-items: center;    /* Vertical center alignment */
    gap: 8px;               /* Horizontal spacing */
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(7 102 140 / 90%);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: #243255;
    border: 1px solid var(--primary);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header h3 { font-size: 2rem; margin-bottom: 5px; }
.modal-meta { color: var(--primary); font-style: italic; margin-bottom: 20px; }
.modal-desc { line-height: 1.7; color: #dbeafe; margin-bottom: 25px; }

.spec-grid {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: var(--radius-md);
    display: grid;
    gap: 10px;
}

.spec-item strong { color: var(--highlight); font-weight: 500; margin-right: 8px; }

.close-modal-btn {
    width: 100%;
    margin-top: 25px;
    padding: 12px;
    background: var(--mid-blue);
    border: none;
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal-btn:hover { background: var(--primary); }

/* Footer & Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 40px 0;
    align-items: center;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Keep pagination circles or make square? 3px radius implies square */
    border-radius: var(--radius-sm);
    background: rgba(0, 127, 209, 0.2);
    border: 1px solid var(--border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
}

.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-num { display: block; font-size: 1.5rem; color: white; font-weight: 700; }
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


/* Top 20 Badge */
.top20-badge {
    /* this section to fix position of top20 badge */
    position: absolute;
    right: 10px;
    top: 5px;
}
.top20-badge-img {
    height: 35px;
}

/* specific areas (using id) */
div#phone-attribute-top, div#phone-attribute-bottom {
    margin-top: 10px;
    margin-bottom: 10px;
}
span#label-key-features {
    font-size: 15px;
}

/* =============== SIMPLIFIED TIKTOK BLURB - TEXT CLICK TO EXPAND =============== */

/* Base blurb styling - both have same styling initially */
.phone-blurb, 
.phone-blurb-full {
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer; /* Indicate it's clickable */
    transition: all 0.3s ease;
    margin: 0;
}

/* Excerpted blurb (truncated) */
.phone-blurb {
    color: var(--text-muted);

    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show only 3 lines */
    -webkit-box-orient: vertical;
    height: 4.5em; /* Fixed height for 3 lines */
}


/* Full blurb (hidden by default) */
.phone-blurb-full {

    color: #fff;
    border-radius: 13px;

    position: absolute;
    bottom: -30px; /* expand from bottom, not from top */

    transform: translateX(0%) translateY(50%); /* center horizontally */
    transition: all 0.4s cubic-bezier(0.46, 1.43, 0.73, 1.2);

    width: 95%; /* make the layering visible  for effect */
    opacity: 0;
    visibility: hidden;
    background: rgba(7, 44, 140, 0.9); /* Slightly darker background for overlay */
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow-y: auto;

    /* Keep your existing min-height */
    min-height: calc(1.5em * 7); /* line-height × 7 lines */
    /* Replace your max-height with this: */
    max-height: 350px; /* Adjust as needed */

    /* Ensure it can scroll vertically when content overflows */
    overflow-y: auto; /* Changed from overflow-y: auto */

    padding-bottom: 35px;
    padding-top: 15px;

    /* Add visual cues that content is scrollable */
    /* 1. Subtle gradient fade at bottom */
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 85%,
        transparent 100%
    );    

}

/* Expanded state */
.phone-blurb.truncated {
    /* Normal state - visible */
    opacity: 1;
    visibility: visible;
}

.phone-blurb-full.expanded {
    /* When expanded - full text overlays */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);

    /* Ensure it can scroll vertically when content overflows */
    overflow-y: auto; /* Changed from overflow-y: auto */

}

/* Visual feedback on hover for truncated text */
.phone-blurb.truncated:hover {
    color: #b0d4e3; /* Lighten text color on hover */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .phone-blurb {
        font-size: 0.85rem;
    }
}
.phone-blurb-container {
    position: relative;
    min-height: 4.5em; /* Minimum height for 3 lines (1.5em line-height × 3 lines) */
    margin-bottom: 20px;

}


/** end tiktok style blurb **/





