/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    color: #333;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px 30px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 10px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
    padding: 20px 0;
}

/* Card Styles */
.card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
}

.portrait {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 15px;
    text-align: center;
    background: white;
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flag {
    font-size: 1.2rem;
    margin: 0;
}

/* Profile Page Styles */
.fixed-back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-block;
    padding: 10px 20px;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    font-weight: 400;
    transition: background 0.2s ease;
    border: 1px solid #1a1a1a;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fixed-back-button:hover {
    background: #333;
    border-color: #333;
}

.back-button-bottom {
    display: inline-block;
    padding: 12px 30px;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    font-weight: 400;
    margin-top: 40px;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    border: 1px solid #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back-button-bottom:hover {
    background: #333;
    border-color: #333;
}

.profile {
    background: white;
    padding: 40px;
    border: 1px solid #e8e8e8;
    margin-bottom: 40px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e8e8e8;
}

.profile-image {
    flex-shrink: 0;
}

.profile-image img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border: 1px solid #e8e8e8;
}

.profile-title h1 {
    font-size: 2rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-flag {
    font-size: 2rem;
    margin: 0;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stacked-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-card {
    background: #fafafa;
    padding: 20px;
    display: flex;
    gap: 15px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.detail-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-card.highlight {
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
}

.detail-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.detail-content h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-content p {
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.6;
    font-weight: 400;
}

.detail-content p a {
    color: #1a1a1a;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.detail-content p a:hover {
    color: #555;
}

.fact-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-top: 15px;
    border: 1px solid #e8e8e8;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .fixed-back-button {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .profile {
        padding: 25px 15px;
        margin-top: 50px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-image img {
        width: 180px;
        height: 180px;
    }

    .profile-title h1 {
        font-size: 1.5rem;
    }

    .profile-flag {
        font-size: 1.5rem;
    }

    .profile-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 15px 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-content h3 {
        font-size: 1rem;
    }

    .profile {
        padding: 20px 15px;
    }

    .profile-image img {
        width: 150px;
        height: 150px;
    }

    .profile-title h1 {
        font-size: 1.3rem;
    }
}
