/* Base Styles */
:root {
    --primary-color: #ff5350;
    --secondary-color: #3b5ba7;
    --tertiary-color: #ffcb05;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--tertiary-color);
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #2a4580;
}

/* Card Container Styles */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.card-image {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    overflow: hidden;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-title {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
}

.pokemon-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--tertiary-color);
    color: var(--text-color);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    position: relative;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-button:hover {
    color: var(--text-color);
}

.modal-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .modal-card {
        flex-direction: row;
    }
}

.modal .card-image {
    flex: 1;
    height: auto;
    min-height: 300px;
    background-color: #f0f0f0;
    border-radius: 10px;
}

.card-info {
    flex: 1;
    padding: 20px;
}

.pokemon-id {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.name-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.name-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.name-section h3 {
    width: 100px;
    font-size: 1rem;
    color: var(--secondary-color);
}

.pokemon-name {
    font-size: 1.2rem;
    font-weight: 600;
    flex-grow: 1;
}

.audio-button {
    background-color: var(--tertiary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.audio-button:hover {
    background-color: #e6b800;
}

.evolution-section {
    margin-top: 20px;
}

.evolution-section h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.evolution-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.evolution-card:hover {
    background-color: #e0e0e0;
}

.evolution-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.evolution-info {
    flex-grow: 1;
}

.evolution-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.evolution-id {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Random Pokemon Styles */
.random-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.random-card {
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-color);
    cursor: pointer;
    max-width: 300px;
    transition: transform 0.3s;
}

.random-card:hover {
    transform: scale(1.05);
}

.random-card .card-image {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .name-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .name-section h3 {
        width: auto;
    }
    
    .random-card {
        max-width: 250px;
    }
    
    .random-card .card-image {
        height: 250px;
    }
}
