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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #EDEEF7;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(184, 181, 255, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #7868E6, #B8B5FF);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #7868E6;
    font-weight: bold;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(120, 104, 230, 0.05) 2px, transparent 0);
    background-size: 30px 30px;
}

.hero h2 {
    font-size: 2.5rem;
    color: #7868E6;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Search Container */
.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #B8B5FF;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    border-color: #7868E6;
    box-shadow: 0 0 10px rgba(120, 104, 230, 0.2);
}

.search-btn {
    background: #7868E6;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #6b59d3;
    transform: scale(1.05);
}

/* Age Filters */
.age-filters {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.age-filters h3 {
    color: #7868E6;
    margin-bottom: 1rem;
    text-align: center;
}

.age-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.age-btn {
    background: #E4FBFF;
    color: #7868E6;
    border: 2px solid #B8B5FF;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.age-btn:hover,
.age-btn.active {
    background: #7868E6;
    color: white;
    transform: translateY(-2px);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: #7868E6;
    font-size: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem;
    border: 2px solid #B8B5FF;
    border-radius: 10px;
    background: white;
    color: #7868E6;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.filter-select:focus {
    border-color: #7868E6;
}

/* Toys Grid */
.toys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.toy-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #7868E6, #B8B5FF, #E4FBFF);
}

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

.toy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.toy-title {
    color: #7868E6;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.toy-age {
    background: #FFB4B4;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.toy-category {
    background: #E4FBFF;
    color: #7868E6;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.toy-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.toy-benefits {
    background: #EDEEF7;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.toy-benefits h4 {
    color: #7868E6;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.toy-benefits p {
    color: #666;
    font-size: 0.9rem;
}

.toy-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.favorite-btn:hover {
    background: rgba(255, 180, 180, 0.2);
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #FFB4B4;
}

.toy-price {
    color: #7868E6;
    font-weight: bold;
    font-size: 1.1rem;
}

.toy-store {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Form Styles */
.toy-form {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #7868E6;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #B8B5FF;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #7868E6;
    box-shadow: 0 0 10px rgba(120, 104, 230, 0.2);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #7868E6;
    color: white;
}

.btn-primary:hover {
    background: #6b59d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #EDEEF7;
    color: #7868E6;
    border: 2px solid #B8B5FF;
}

.btn-secondary:hover {
    background: #B8B5FF;
    color: white;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #7868E6;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #FFB4B4;
    transform: scale(1.2);
}

/* Message Container */
.message-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.message.success {
    background: #E4FBFF;
    color: #7868E6;
    border-left: 4px solid #7868E6;
}

.message.error {
    background: #FFB4B4;
    color: white;
    border-left: 4px solid #ff9999;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.no-results p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: #7868E6;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .search-container {
        flex-direction: column;
        max-width: 100%;
    }
    
    .age-buttons {
        justify-content: center;
    }
    
    .age-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        justify-content: center;
    }
    
    .toys-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .message-container {
        right: 10px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .toy-card {
        padding: 1rem;
    }
    
    .toy-form {
        padding: 1.5rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .nav-btn {
        flex: 1;
        text-align: center;
        min-width: 0;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .nav,
    .search-container,
    .age-filters,
    .filters,
    .toy-actions,
    .modal {
        display: none !important;
    }
    
    .toys-grid {
        grid-template-columns: 1fr;
    }
    
    .toy-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Better Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #7868E6;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toy-card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}
