/* Base Styles */
:root {
    --primary-color: #ff9c00;
    --secondary-color: #0a0e31;
    --accent-color: #ff4b4b;
    --text-color: #333;
    --light-color: #fff;
    --dark-color: #222;
    --gray-color: #f4f4f4;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--gray-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: #e68a00;
    transform: translateY(-2px);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: var(--light-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-direction: row;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
    white-space: nowrap;
}

.logo span {
    color: var(--primary-color);
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    font-weight: 600;
    padding: 10px 5px;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(10, 14, 49, 0.8), rgba(10, 14, 49, 0.8)), url('https://clashofclans.com/uploaded-images-blog/clash-of-clans-10th-anniversary.jpg') no-repeat center center/cover;
    color: var(--light-color);
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Recipes Section */
.recipes {
    padding: 80px 0;
    background-color: var(--light-color);
}

.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.filter-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.filter-title {
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.recipe-filter,
.townhall-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn,
.th-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--secondary-color);
    padding: 8px 20px;
    margin: 0 10px 10px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover,
.th-btn.active,
.th-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.recipe-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-recipes-message {
    text-align: center;
    padding: 30px;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin: 20px 0;
}

.recipe-card {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: center;
}

.recipe-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.recipe-header {
    padding: 15px 20px;
    background-color: var(--secondary-color);
    color: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 250px;
    border-radius: 10px 0 0 10px;
}

.recipe-title {
    font-size: 1.3rem;
    margin: 0;
}

.recipe-type {
    background-color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.recipe-troops,
.recipe-spells,
.recipe-heroes {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #f9f9f9;
    border-left: 1px solid var(--border-color);
    flex: 1;
    align-items: center;
}

.troop-item,
.spell-item,
.hero-item {
    position: relative;
    width: 50px;
    height: 50px;
}

.troop-item img,
.spell-item img,
.hero-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.troop-count,
.spell-count,
.hero-count {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: var(--light-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.recipe-footer {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid var(--border-color);
    min-width: 180px;
}

.recipe-rating {
    display: flex;
    margin-bottom: 15px;
    justify-content: center;
}

.rating-star {
    color: #ddd;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    margin: 0 2px;
}

.rating-star:hover,
.rating-star.active {
    color: var(--primary-color);
}

.copy-btn,
.details-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.details-btn {
    background-color: var(--secondary-color);
}

.details-btn:hover {
    background-color: #161c5e;
}

/* About Section */
.about {
    padding: 80px 0;
    background-color: var(--gray-color);
}

.about p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 20px;
    font-size: 1.1rem;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background-color: var(--light-color);
}

.contact p {
    text-align: center;
    margin-bottom: 40px;
}

#contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 156, 0, 0.2);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

#contact-form .btn {
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--light-color);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--light-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.social-links a {
    color: var(--light-color);
    margin: 0 10px;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

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

.modal-content {
    background-color: var(--light-color);
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalopen 0.4s;
}

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

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-body {
    padding: 20px 0;
}

.recipe-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.recipe-info span {
    background-color: var(--secondary-color);
    color: var(--light-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.composition-section {
    margin-bottom: 30px;
}

.composition-section h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.troops-container,
.spells-container,
.heroes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.recipe-description {
    margin-bottom: 30px;
}

.recipe-description h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.recipe-actions {
    display: flex;
    gap: 15px;
}

#modal-copy-btn {
    background-color: var(--primary-color);
}

#modal-share-btn {
    background-color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .recipe-card {
        flex-direction: column;
    }
    
    .recipe-header {
        width: 100%;
        border-radius: 10px 10px 0 0;
    }
    
    .recipe-troops,
    .recipe-spells,
    .recipe-heroes {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .recipe-footer {
        border-left: none;
        border-top: 1px solid var(--border-color);
        width: 100%;
    }
    
    .recipe-actions {
        flex-direction: column;
    }
    
    .copy-btn, .details-btn {
        width: 100%;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px 10px;
    }
}

@media (max-width: 480px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}