/* ==========================================================================
   MODERNIZED PEPTIDE PROTOCOLS - MAIN STYLES
   Updated with unified search & tags glassmorphism design
   ========================================================================== */

/* ==========================================================================
   MODERN FONT IMPORT
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   GLOBAL STYLES & RESET
   ========================================================================== */

.protocol-attribution {
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0f1c 0%, #1a1f2e 25%, #2d3748 50%, #1a202c 100%);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background pattern for modern feel */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   MODERNIZED HEADER & NAVIGATION
   ========================================================================== */

header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 40px;
    letter-spacing: 0.025em;
    text-transform: none;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.3) 50%, transparent 100%);
    margin: 32px 0;
}

/* ==========================================================================
   UNIFIED SEARCH & TAGS CONTAINER - NEW IMPROVED DESIGN
   ========================================================================== */

.search-tags-unified {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    padding: 24px;
    margin: 0 auto 40px;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.search-tags-unified:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Legacy search container styles for compatibility */
.search-container {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    padding: 24px;
    margin: 0 auto 40px;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.search-container:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Unified search input styling */
.search-input,
.search-box,
#searchInput {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.search-input:focus,
.search-box:focus,
#searchInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(30, 41, 59, 1);
}

.search-input::placeholder,
.search-box::placeholder,
#searchInput::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* ==========================================================================
   UNIFIED TAGS CONTAINER WITH MORE BUTTON
   ========================================================================== */

.tags-container,
.filter-container {
    position: relative;
}

.tags-list,
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    transition: all 0.3s ease;
    justify-content: flex-start;
    align-items: center;
}

.tags-list.collapsed,
.filter-tags.collapsed {
    max-height: 40px;
    overflow: hidden;
    position: relative;
}

.tags-list.collapsed::after,
.filter-tags.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 40px;
    background: linear-gradient(90deg, transparent 0%, rgba(15, 23, 42, 0.6) 70%);
    pointer-events: none;
}

/* Individual tag buttons - unified styling */
.tag-button,
.filter-tag,
.tag[data-filter],
.filter-tags .tag {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: capitalize;
    display: inline-block;
    user-select: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.tag-button:hover,
.filter-tag:hover,
.tag[data-filter]:hover,
.filter-tags .tag:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.tag-button.active,
.filter-tag.active,
.tag[data-filter].active,
.filter-tags .tag.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
    z-index: 2;
}

/* More button styling */
.more-button,
.show-more-button {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 8px;
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.more-button:hover,
.show-more-button:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.more-button.expanded {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.more-button.expanded:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Results counter */
.results-counter,
.search-results-count {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    font-weight: 500;
}

.results-counter strong,
.search-results-count strong {
    color: #60a5fa;
}

/* ==========================================================================
   PEPTIDE CARDS GRID
   ========================================================================== */

.peptides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    padding: 20px 0;
    animation: fadeInUp 0.6s ease-out;
}

.peptide-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: block;
    opacity: 1;
    visibility: visible;
}

.peptide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

.peptide-card.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.peptide-card.visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.card-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 32px 24px 24px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.peptide-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.card-content {
    padding: 24px;
}

.section {
    margin-bottom: 24px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-left: 16px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 2px;
}

.section-content {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
    text-transform: capitalize;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .peptides-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .peptide-card {
        border-radius: 16px;
    }
    
    .card-header {
        padding: 24px 20px 20px;
    }
    
    .peptide-name {
        font-size: 1.25rem;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .section-content {
        padding: 16px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 0.8rem;
        padding-left: 12px;
    }
    
    .section-title::before {
        width: 3px;
        height: 12px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-tags-unified,
    .search-container {
        margin-left: 16px;
        margin-right: 16px;
        padding: 20px;
    }
    
    .search-input,
    .search-box,
    #searchInput {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .tag-button,
    .filter-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .tags {
        gap: 6px;
    }
    
    .tag {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        padding: 30px 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .peptide-card {
        border-radius: 16px;
    }
    
    .card-header {
        padding: 24px 20px 20px;
    }
    
    .peptide-name {
        font-size: 1.25rem;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .section-content {
        padding: 16px;
        font-size: 0.9rem;
    }
    
    .search-tags-unified,
    .search-container {
        padding: 16px;
    }
    
    .search-input,
    .search-box,
    #searchInput {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .tag-button,
    .filter-tag {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .more-button {
        width: 100px;
        font-size: 0.8rem;
    }
}