body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.word {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.definition {
    font-size: 1.2em;
    color: #34495e;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.synonyms {
    margin: 20px 0;
}

.synonyms h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.synonyms ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.synonyms li {
    background: #e9ecef;
    padding: 5px 15px;
    border-radius: 20px;
    color: #495057;
}

.images {
    margin-top: 30px;
}

.images h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.image-item {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
}

.image-item img.loading {
    filter: blur(10px);
    transform: scale(1.1);
}

.image-item img.loaded {
    filter: blur(0);
    transform: scale(1);
}

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

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.9em;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.error {
    color: #dc3545;
    padding: 10px;
    margin: 10px 0;
    background: #f8d7da;
    border-radius: 4px;
}

.next-word-form {
    margin-top: 30px;
    text-align: center;
}

.next-button {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.next-button:hover {
    background-color: #34495e;
}

.next-button:active {
    transform: translateY(1px);
}

/* Home page styles */
.title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2.5em;
}

.word-input {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    font-size: 1.1em;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #2c3e50;
}

.submit-button, .random-button {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover, .random-button:hover {
    background-color: #34495e;
}

.submit-button:active, .random-button:active {
    transform: translateY(1px);
}

.random-word {
    text-align: center;
}

.random-button {
    background-color: #27ae60;
}

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

@media only screen and (max-width: 40em) {
    .container {
        padding: 15px;
    }
    
    .word {
        font-size: 2em;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .submit-button, .random-button {
        width: 100%;
    }
}