    * {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a90e2 0%, #7b8794 100%);
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    margin-top: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Search Section Styles */
.search-section {
    margin-bottom: 30px;
}

.search-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 5px;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button.active {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Search Content */
.search-content {
    position: relative;
}

.search-tab {
    display: none;
    animation: fadeIn 0.3s ease;
}

.search-tab.active {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input Styles */
input, select {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 250px;
}

input:focus, select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.type-dropdown {
    background: white;
    cursor: pointer;
}

.dual-type-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.dual-type-container select {
    flex: 1;
    min-width: 200px;
}

/* Random Pokemon Styles */
.random-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.random-description {
    color: #6c757d;
    font-size: 1.1em;
    text-align: center;
    margin: 0;
    font-style: italic;
}

.random-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    font-size: 18px;
    padding: 18px 30px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.random-btn:hover {
    background: linear-gradient(135deg, #218838, #1fa085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item .pokemon-id {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.autocomplete-item .pokemon-name {
    color: #2c3e50;
    font-weight: 600;
    text-transform: capitalize;
}

/* Button Styles */
.search-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Pokemon Info Styles */
.pokemon-info {
    margin-top: 30px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    justify-content: center;
}

.pokemon-card-detailed {
    background: linear-gradient(135deg, #397ec4 0%, #355291 50%, #6c7b8a 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    color: white;
    position: relative;
    overflow: hidden;
}

.pokemon-card-detailed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
}

.pokemon-card-detailed h2 {
    color: white;
    margin-bottom: 25px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

/* Pokemon image container with toggle */
.pokemon-image-container {
    position: relative;
    display: inline-block;
    margin: 0px 0 0px 0;
}

.pokemon-card-detailed img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Shiny toggle button */
.shiny-toggle-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    padding: 8px 12px;
    color: white;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.shiny-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.shiny-toggle-btn.shiny-active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.toggle-icon {
    font-size: 1.1em;
}

.toggle-text {
    font-size: 0.85em;
}

.pokemon-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
    text-align: left;
}

@media (max-width: 480px) {
    .pokemon-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.pokemon-info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pokemon-info-item strong {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pokemon-info-item span {
    font-size: 1.1em;
    font-weight: 600;
}

.pokemon-info-section {
    margin: 15px 0;
}

.info-group {
    margin-bottom: 15px;
}

.info-group h4 {
    color: white;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 600;
}

.pokemon-info-item.full-width {
    grid-column: 1 / -1;
}

.pokemon-info-item.combined-item {
    grid-column: 1 / -1;
}

.combined-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.info-part {
    flex: 1;
    text-align: center;
}

.info-part strong {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-part span {
    font-size: 1.1em;
    font-weight: 600;
}

/* Single item layout for abilities and experience */
.pokemon-info-single {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.pokemon-info-item.single-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.pokemon-info-item.single-item strong {
    color: white;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.pokemon-info-item.single-item span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    line-height: 1.4;
}

/* Type Effectiveness Container */
.type-effectiveness-container {
    margin: 30px auto 0 auto;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.type-effectiveness-container h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.effectiveness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    justify-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.effectiveness-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.effectiveness-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.effectiveness-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.95em;
}

.effectiveness-icon {
    font-size: 1.2em;
}

.effectiveness-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* Card specific colors */
.strong-against-card {
    border-left: 4px solid #4ecdc4;
}

.weakness-card {
    border-left: 4px solid #ff6b6b;
}

.resistance-card {
    border-left: 4px solid #51cf66;
}

.immunity-card {
    border-left: 4px solid #ffd43b;
}

/* Type badge styles - clean without borders */
.type-badge.strong-against,
.type-badge.weakness,
.type-badge.resistance,
.type-badge.immunity {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .pokemon-info-item.full-width {
        grid-column: 1;
    }
    
    .info-group {
        margin-bottom: 12px;
    }
    
    .info-group h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    /* Type effectiveness mobile fixes */
    .type-effectiveness-container {
        margin: 20px 5px 0 5px !important;
        padding: 10px !important;
        overflow: hidden;
        width: calc(100% - 10px) !important;
        max-width: calc(100vw - 20px) !important;
        box-sizing: border-box;
    }
    
    .effectiveness-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden;
        justify-content: stretch !important;
        justify-items: stretch !important;
    }
    
    .effectiveness-card {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
        padding: 12px !important;
    }
    
    .effectiveness-types {
        gap: 3px !important;
        justify-content: center !important;
    }
    
    .type-badge {
        font-size: 0.75em !important;
        padding: 3px 6px !important;
        margin: 1px !important;
    }
    
    .pokemon-info-section {
        margin: 10px 0;
    }
}

.pokemon-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-top: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pokemon-stats h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.3em;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-name {
    font-size: 0.8em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 700;
    margin-top: 5px;
}

/* Stat-specific colors - Soft but readable tones */
.stat-hp {
    background: linear-gradient(135deg, #E85A5A, #D64545) !important;
}

.stat-attack {
    background: linear-gradient(135deg, #F0A366, #E8935A) !important;
}

.stat-defense {
    background: linear-gradient(135deg, #6B8AFF, #5A7AFF) !important;
}

.stat-specialattack {
    background: linear-gradient(135deg, #9A6BFF, #8A5AFF) !important;
}

.stat-specialdefense {
    background: linear-gradient(135deg, #66D9A3, #5AC995) !important;
}

.stat-speed {
    background: linear-gradient(135deg, #E866C7, #D955B8) !important;
}

/* Pokemon List Styles */
.pokemon-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.pokemon-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform: translateY(0);
}

.pokemon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.pokemon-card:active {
    transform: translateY(-4px);
    transition: all 0.1s ease;
}

.pokemon-card img {
    width: 100px;
    height: 100px;

    margin-bottom: 10px;
}

.pokemon-card h4 {
    color: #2c3e50;
    margin: 10px 0 5px 0;
    text-transform: capitalize;
}

.pokemon-card p {
    color: #6c757d;
    font-size: 0.9em;
    margin: 5px 0;
}

/* Type badges */
.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin: 2px;
    text-transform: uppercase;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .search-tab.active {
        flex-direction: column;
    }
    
    input, select {
        min-width: 200px;
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .pokemon-card-detailed {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .pokemon-card-detailed h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .pokemon-card-detailed img {
        width: 200px;
        height: 200px;
        margin: 15px 0 20px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .dual-type-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .dual-type-container select {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 8px;
    }
    
    .pokemon-card-detailed {
        padding: 20px 15px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .pokemon-card-detailed:hover {
        transform: translateY(-3px);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    }
    
    .pokemon-card-detailed h2 {
        font-size: 1.6em;
    }
    
    .pokemon-card-detailed img {
        width: 200px;
        height: 200px;
    }
    
    .pokemon-info-item {
        padding: 12px;
    }
    
    .pokemon-info-item strong {
        font-size: 0.8em;
    }
    
    .pokemon-info-item span {
        font-size: 1em;
    }
    
    .pokemon-stats {
        padding: 12px;
        margin-top: 10px;
    }
    
    .pokemon-stats h3 {
        margin-bottom: 8px;
        font-size: 1.1em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .stat-item {
        padding: 6px;
    }
    
    .stat-name {
        font-size: 0.7em;
    }
    
    .stat-value {
        font-size: 1em;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    /* Mobile Pokemon Grid - At least 2 per row */
    .pokemon-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .pokemon-card {
        padding: 15px 10px;
        min-height: 180px;
    }
    
    .pokemon-card img {
        width: 100px;
        height: 100px;
    }
    
    .pokemon-card h4 {
        font-size: 0.9em;
        margin: 8px 0 4px 0;
    }
    
    .pokemon-card p {
        font-size: 0.8em;
        margin: 3px 0;
    }
    
    .combined-content {
        gap: 15px;
    }
    
    .info-part strong {
        font-size: 0.8em;
    }
    
    .info-part span {
        font-size: 1em;
    }
}
