/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header h1 {
    background: linear-gradient(135deg, #8b5cf6, #a855f7, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.header p {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.8;
}

.container {
    max-width: 1000px;
    margin: 3rem auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

/* Ad Placeholders */
.ad-placeholder {
    background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.ad-horizontal {
    height: 100px;
    min-height: 90px;
}

.ad-vertical {
    height: 250px;
    width: 100%;
}

.ad-section-break {
    margin: 3rem 0;
}

.ad-content {
    text-align: center;
    color: #64748b;
}

.ad-content span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.ad-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Calculator Form */
.calculator-form {
    margin-bottom: 3rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.75rem;
}

.input-group input {
        padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1.1rem;
    background: white;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.calculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    display: none;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.results-section.show {
    display: block;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.results-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2rem;
}

/* Age Display Grids */
.age-grid, .time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.age-card {
    background: #f1f5f9;
    padding: 2rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.age-card:hover {
    transform: translateY(-2px);
}

.age-number {
    font-size: 3rem;
    font-weight: 700;
    color: #8b5cf6;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.age-label {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

/* Total Time Lived Section */
.total-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.total-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.total-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.timezone {
    font-size: 0.9rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #d1d5db;
}

/* Updated Total Grid - Single Row */
.total-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.total-card {
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
        margin: 2rem 1rem 2rem 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    transition: transform 0.2s ease;
}

.total-card:hover {
    transform: translateY(-2px);
}

.total-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.total-number {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

/* Celebrity Section */
.celebrities-section {
    background: #f8fafc;
    margin: 1.5rem -2rem -2rem;
    padding: 4rem 2rem 2rem;
    border-radius: 0 0 12px 12px;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #8b5cf6;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* Celebrity Wrapper with Sidebar Ad */
.celebrities-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-bottom: 3rem;
}

.ad-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Celebrity Grid */
.celebrity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.celebrity-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.celebrity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.celebrity-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.celebrity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}
}

.celebrity-placeholder {
    font-weight: 700;
    font-size: 2rem;
}

.celebrity-info {
        margin: 2rem 1rem 2rem 1rem;
}

.celebrity-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.celebrity-category {
    background: #8b5cf6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.celebrity-age {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.celebrity-birthday {
    color: #8b5cf6;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Load More */
.load-more-section {
    text-align: center;
}

.load-more-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
}

.footer-container {
    width: 100%;
    padding: 1rem 2rem;
    text-align: right;
}

.copyright {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Live Update Pulse */
.live-update {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .container {
        margin: 2rem 1rem;
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .footer-container {
        padding: 1rem;
        text-align: center;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .age-grid, .time-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .age-card {
        padding: 1.5rem 1rem;
    }
    
    .age-number {
        font-size: 2.5rem;
    }
    
    .total-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .total-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .results-section h2 {
        font-size: 1.8rem;
    }
    
    .celebrities-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ad-sidebar {
        order: -1;
        position: static;
    }
    
    .celebrity-grid {
        grid-template-columns: 1fr;
    }
    
    .celebrities-section {
        margin: 1rem -1.5rem 0;
        padding: 3rem 1.5rem 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 0 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    .container {
        margin: 1.5rem 0.5rem;
        padding: 1rem;

    }
    .footer-container {
        padding: 0.75rem;
    }
    
    .input-group input {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    .calculate-btn {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .age-number {
        font-size: 2rem;
    }
    
    .age-card {
        padding: 1.25rem 0.75rem;
    }
    
    .total-card {
    padding: 1.5rem 1rem;
    }
    
    .total-number {
        font-size: 1.1rem;
    }
    
    .total-grid {
        grid-template-columns: 1fr;
    }
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
/* Force hide celebrity section when needed */
.celebrity-section-hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Celebrity Link Styles */
.celebrity-link {
    margin-top: 0.75rem;
}

.celebrity-link a {
    color: #8b5cf6;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.celebrity-link a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Prevent event bubbling for celebrity links */
.celebrity-link a {
    position: relative;
    z-index: 10;
    display: inline-block;
    padding: 0.25rem 0;
}

.celebrity-name {
    transition: color 0.2s ease;
}

.celebrity-name:hover {
    color: #8b5cf6 !important;
}

/* Birth Information Styles */
.birth-info {
    margin: 2rem 0;
    text-align: center;
}

.birth-day-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.birth-day-label {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.birth-day-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8b5cf6;
    text-transform: capitalize;
}

@media (max-width: 480px) {
    .birth-day-card {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .birth-day-name {
        font-size: 1.5rem;
    }
}

/* Enhanced Celebrity Cards and Modal Styles */

/* Celebrity Grid Improvements */
.celebrity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Celebrity Card Enhancements */
.celebrity-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 400px;
}

.celebrity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.celebrity-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.celebrity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.celebrity-card:hover .celebrity-image img {
    transform: scale(1.05);
}

.celebrity-info {
    padding: 16px;
    background: white;
}

.celebrity-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.celebrity-profession {
    font-size: 0.9rem;
    color: #3498db;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.celebrity-birthday {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.celebrity-age {
    font-size: 0.85rem;
    color: #e74c3c;
    font-weight: 500;
    margin-bottom: 6px;
}

.celebrity-nationality {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-bottom: 10px;
}

.celebrity-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.celebrity-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Celebrity Modal Styles */
.celebrity-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-header {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    align-items: center;
    gap: 30px;
    position: relative;
}

.modal-image {
    width: 150px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.modal-info h2 {
    font-size: 2rem;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.modal-info p {
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.4;
}

.modal-info strong {
    font-weight: 600;
    opacity: 0.9;
}

.modal-bio {
    padding: 30px;
}

.modal-bio h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.modal-bio p {
    color: #5a6c7d;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin: 20px 30px 30px 30px;
    transition: all 0.3s ease;
    text-align: center;
}

.modal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Search Results */
.no-results {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    padding: 40px;
    grid-column: 1 / -1;
}

/* Search Box Styling */
.celebrity-search {
    max-width: 400px;
    margin: 20px auto;
    position: relative;
}

.celebrity-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.celebrity-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    outline: none;
}

.celebrity-search input::placeholder {
    color: #95a5a6;
}

/* Filter Buttons Enhancement */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #5a6c7d;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 40px auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Celebrity Category Icons */
.celebrity-card[data-category="actor"]::before {
    content: "🎭";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 10;
}

.celebrity-card[data-category="musician"]::before {
    content: "🎵";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 10;
}

.celebrity-card[data-category="athlete"]::before {
    content: "⚽";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .celebrity-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        margin: 15px;
    }
    
    .celebrity-card {
        min-height: 350px;
    }
    
    .celebrity-image {
        height: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 20px;
    }
    
    .modal-info h2 {
        font-size: 1.5rem;
    }
    
    .modal-bio {
        padding: 20px;
    }
    
    .category-filter {
        gap: 8px;
        margin: 15px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .celebrity-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        margin: 10px;
    }
    
    .celebrity-card {
        min-height: 320px;
    }
    
    .celebrity-image {
        height: 180px;
    }
    
    .celebrity-info {
        padding: 12px;
    }
    
    .celebrity-name {
        font-size: 1rem;
    }
    
    .modal-image {
        width: 120px;
        height: 160px;
    }
    
    .modal-info h2 {
        font-size: 1.3rem;
    }
}

/* Accessibility Improvements */
.celebrity-card:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.filter-btn:focus,
.load-more-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}
.load-more-btn {
    display: block;
    margin: 40px auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Celebrity Category Icons */
.celebrity-card[data-category="actor"]::before {
    content: "🎭";
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
}

.celebrity-card[data-category="musician"]::before {
    content: "🎵";
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
}

.celebrity-card[data-category="athlete"]::before {
    content: "⚽";
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .celebrity-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        margin: 15px;
    }
    
    .celebrity-card {
        min-height: 180px;
    }
    
    .celebrity-info {
        padding: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 30px 20px 20px 20px;
    }
    
    .modal-info h2 {
        font-size: 1.5rem;
    }
    
    .modal-bio {
        padding: 20px;
    }
    
    .category-filter {
        gap: 8px;
        margin: 15px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .celebrity-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        margin: 10px;
    }
    
    .celebrity-card {
        min-height: 160px;
    }
    
    .celebrity-info {
        padding: 12px;
    }
    
    .celebrity-name {
        font-size: 1rem;
    }
    
    .modal-info h2 {
        font-size: 1.3rem;
    }
    
    .modal-header {
        padding: 25px 15px 15px 15px;
    }
    
    .modal-bio {
        padding: 15px;
    }
}

/* Accessibility Improvements */
.celebrity-card:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.filter-btn:focus,
.load-more-btn:focus,
.celebrity-link:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Clean card layout without images */
.celebrity-card {
    display: flex;
    flex-direction: column;
}

.celebrity-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

/* Enhanced hover effects for text-only cards */
.celebrity-card:hover .celebrity-name {
    color: #667eea;
}

.celebrity-card:hover .celebrity-profession {
    color: #764ba2;
}

/* Remove extra spacing and optimize layout */
.celebrity-card {
    margin-bottom: 0; /* Remove any bottom margin */
}

.celebrity-info {
    padding: 16px; /* Reduce padding */
}

.celebrity-name {
    margin-bottom: 6px; /* Reduce space after name */
}

.celebrity-profession {
    margin-bottom: 4px; /* Reduce space after profession */
}

.celebrity-birthday {
    margin-bottom: 4px; /* Reduce space after birthday */
}

.celebrity-age {
    margin-bottom: 4px; /* Reduce space after age */
}

.celebrity-nationality {
    margin-bottom: 10px; /* Reduce space before button */
}

/* Ensure consistent card heights without excess spacing */
.celebrity-card {
    min-height: 180px; /* Reduced from 200px */
}

/* Tighter grid spacing */
.celebrity-grid {
    gap: 16px; /* Reduced from 20px */
}

@media (max-width: 768px) {
    .celebrity-grid {
        gap: 12px; /* Even tighter on mobile */
    }
    
    .celebrity-info {
        padding: 12px; /* Reduce mobile padding */
    }
    
    .celebrity-card {
        min-height: 160px; /* Smaller on mobile */
    }
}

@media (max-width: 480px) {
    .celebrity-grid {
        gap: 10px;
    }
    
    .celebrity-info {
        padding: 10px;
    }
    
    .celebrity-card {
        min-height: 140px; /* Even smaller on small mobile */
    }
}

/* Fix for inline styles */
#birthInfo.hidden {
    display: none;
}

#betweenSectionsAd.hidden {
    display: none;
}


/* Show elements by removing hidden class */
.birth-info:not(.hidden) {
    display: block;
}

.ad-placeholder:not(.hidden) {
    display: block;
}


/* Additional classes for show/hide functionality */
.results-section.show {
    display: block !important;
}

.celebrity-modal.show {
    display: block !important;
}

.load-more-btn.show {
    display: block !important;
}

.load-more-btn.hide {
    display: none !important;
}


/* Prevent layout thrashing */
.celebrity-card {
    contain: layout;
}

.results-section {
    contain: layout;
}

