/* Search Box */
.search-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-wrapper {
    display: flex;
    align-items: center;
    padding: 0.65rem;
    border-radius: 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.search-wrapper:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 20px var(--glow-primary);
    transform: translateY(-2px);
}

.search-icon {
    padding: 0 1.25rem;
    color: var(--primary-500);
    display: flex;
    align-items: center;
}

.search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 1rem 0;
    font-size: 1.25rem;
    color: white;
    outline: none;
    font-family: var(--font-body);
}

.search-btn {
    padding: 0.85rem 2rem;
    margin-left: 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-aurora));
    color: #050b18;
    text-shadow: none;
    transition: all 0.3s ease;
}

.search-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px var(--primary-500);
}

@media (max-width: 576px) {
    .search-btn {
        padding: 0.85rem;
        min-width: 3.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .search-btn::before {
        content: '';
        width: 1.25rem;
        height: 1.25rem;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>') center/contain no-repeat;
        filter: invert(1);
    }

    .search-btn-text {
        display: none;
    }
}

/* Buttons and Tags */
.btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.tag:hover {
    border-color: var(--accent-aurora);
    color: white;
    background: rgba(0, 255, 135, 0.1);
    box-shadow: 0 0 15px var(--glow-aurora);
}

/* Ambient Blobs (Optimized for performance) */
.ambient-bg {
    display: none;
    /* Replaced by Hero BG and radial overlays */
}

/* Cards & Glass Effects */
.glass-border-effect {
    position: relative;
    border: 1px solid transparent;
    background-image: linear-gradient(var(--midnight), var(--midnight)), var(--border-gradient);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

.glass-card {
    padding: 1.75rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-card-bg);
    backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.news-card {
    text-decoration: none;
    display: block;
    color: inherit;
}

.card-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.news-snippet {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-tertiary);
}

/* Skeleton Loading */
.skeleton-card {
    height: 180px;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

/* Icon Buttons & Theme Toggle */
.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--glass-card-hover);
    border-color: var(--primary-500);
    box-shadow: 0 0 15px var(--glow-primary);
    transform: translateY(-2px);
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Glass Select */
.glass-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.glass-select:focus {
    border-color: var(--glow-primary);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    padding: 2.5rem;
    position: relative;
    overflow-y: auto;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ESG Badges */
.esg-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.esg-safe {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.esg-warning {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: pulse 2s infinite;
}

/* Modal Animation */
.animate-modal-in {
    animation: modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Theme Icon Visibility Logic */
#theme-toggle .icon-sun {
    display: none;
}

#theme-toggle .icon-moon {
    display: block;
}

html:not(.dark) #theme-toggle .icon-sun {
    display: block;
}

html:not(.dark) #theme-toggle .icon-moon {
    display: none;
}