@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

/** NEW STYLES FOR MOBILE AND DESKTOP VIEWS **/

/* Container */
.container {
    padding: 1rem 2rem 8rem 2rem
}

.container.map {
    padding: 0;
}

/* Header */
header {
    background-color: #1a1a1a;
    padding: 1rem 2rem;
}

header.sticky {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Desktop Navigation - Hidden on mobile */
.desktop-nav {
    display: none;
}

.desktop-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: #9DD3FF;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: border-bottom 0.3s;
    margin: 0 0.25rem;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    border-color: #9DD3FF;
}

/* Search Bar */
.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.search-bar::placeholder {
    color: #888;
}

.search-bar:focus {
    outline: none;
    border-color: #9DD3FF;
    box-shadow: 0 0 0 2px rgba(157, 211, 255, 0.2);
}

/* Hide search bar on non-homepage */
body:not(.homepage) .search-bar {
    display: none;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #212121;
    border-top: 1px solid #333;
    display: flex;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    text-decoration: none;
    color: #888;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: #9DD3FF;
}

.nav-item:hover {
    color: #9DD3FF;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    stroke: currentColor;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .container {
        padding-bottom: 2em; /* Remove extra mobile nav space */
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .desktop-nav {
        display: block;
    }
    
    .mobile-nav {
        display: none;
    }
    
    .search-bar {
        width: 300px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    header {
        padding: 1rem 0;
    }
    
    .header-content {
        margin: 0 auto;
        padding: 0 2rem;
    }
}

/* MOBILE AND DESKTOP VIEWS END */

/** SCROLL TO TOP BUTTON **/
/* Updated Scroll-to-Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1001; /* Higher than mobile nav (1000) */
}

.scroll-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top::before {
    content: "↑";
    font-weight: bold;
    position: relative;
    top: -2px;
}

/* Mobile Adjustments - Move button above bottom nav */
@media (max-width: 767px) {
    .scroll-to-top {
        bottom: 100px; /* Move above mobile nav (which is ~70px tall) */
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .scroll-to-top::before {
        font-size: 20px;
        font-weight: 900;
    }
}

/** SCROLL TO TOP BUTTON END **/


body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

h1 {
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(42px, 3vw, 58px);
    font-weight: 500;
}

h2 {
    font-family: 'Rubik', sans-serif;
    font-weight: bold;
    font-size: clamp(24px, 2vw, 32px);
}

.temtem-list, .dojo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.temtem-item, .dojo-item {
    display: flex;
    background-color: #212121;
    border-radius: 8px;
    padding: 0.75rem;
    max-width: 100%;
    align-items: center;
    gap: 1rem;
}

.dojo-item {
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
}

.temtem-image-container, .dojo-image-container {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
}

.temtem-image-container img, .dojo-image-container img {
    border-radius: 5px;
    height: 100%;
    width: 100%;
    object-fit: contain;
    margin-right: 0;
}

.dojo-image-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.dojo-image-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 5px;
    margin-right: 0;
}

.temtem-details, .dojo-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.temtem-details:not(.temtem-types), .dojo-details:not(.dojo-types) {
    position: relative;
}

.temtem-name, .dojo-master {
    font-size: clamp(1rem, 2.5vw, 22px);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    line-height: 1.2;
}

.temtem-number, .dojo-name {
    font-size: clamp(14px, 2vw, 1rem);
    color: #aaa;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
}

.temtem-types, .dojo-types {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin-top: 0.25rem;
    justify-content: flex-start;
    align-items: center;
}

.temtem-type, .dojo-type {
    border: 2px solid #616161;
    border-radius: 20px;
    color: #e9e9e9;
    padding: clamp(0.1rem, 0.5vw, 0.2rem) clamp(0.4rem, 1vw, 0.6rem);
    margin: 0;
    font-size: clamp(14px, 2vw, 1rem);
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.dojo-info .dojo-type, .temtem-info .temtem-type {
    min-width: 5rem;
}


#dojo-name, #temtem-number {
    color: #878787;
}

.dojo-type.extra-count {
    width: clamp(1.8rem, 3vw, 1.9rem);
    height: clamp(1.8rem, 3vw, 1.9rem);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.temtem-type > p, .dojo-type > p {
    display: inline-block;
    margin: 0;
    position: relative;
    right: 3px;
    top: 1px;
}

.dojo-type.extra-count > p{
    font-size: 0.8rem;
    right: unset;
    top: unset;
}

.type-image-container {
    display: inline-block;
    height: 24px;
    vertical-align: middle;
    width: 24px;
}

.type-image-container > img {
    height: 100%;
    object-fit: none;
    width: 100%;
}

a {
    color: #9DD3FF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

hr {
    margin-bottom: 0.25rem;
}

.site-nav {
    text-align: center;
    margin-bottom: 1rem;
}

.site-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #212121;
    color: #9DD3FF;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
    margin: 0 0.25rem;
}

.site-nav a:hover {
    background-color: #555;
}

.back-button {
   background-color: #1a1a1a;
   color: #ddd;
   border: 2px solid #838383;
   padding: 0.5rem 1rem;
   border-radius: 5px;
   cursor: pointer;
   font-family: 'Inter', sans-serif;
   font-size: 1rem;
   margin-bottom: 1rem;
   transition: all 0.3s ease;
   position: relative;
   top: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.4rem;
   line-height: 1;
}

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

.back-button .arrow {
   font-size: 1.2rem;
   font-weight: bold;
   display: flex;
   align-items: center;
   line-height: 1;
}

.dojo-detail-container, .temtem-detail-container {
    margin-top: 1rem;
}

.dojo-header, .temtem-header {
    background-color: #212121;
    border-radius: 8px;
    display: flex;
    margin-bottom: 2rem;
    padding: 1rem;
    align-items: center;
    gap: 2rem;
}

.dojo-header .dojo-image-container, .temtem-header .temtem-image-container {
    border-right: 2px solid #D9D9D9;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    padding-right: 1rem;
}

.dojo-header .dojo-image-container img, .temtem-header .temtem-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    margin-right: 0;
}

.dojo-info, .temtem-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.dojo-info h2, .temtem-info h2 {
    margin: 0;
    font-size: clamp(22px, 4vw, 32px);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1;
}

.dojo-info > p, .temtem-info > p {
    margin: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.dojo-info .dojo-types, .temtem-info .temtem-types {
    padding: 0;
    margin: 0;
    justify-content: left;
    text-align: left;
}

.temtems-section {
    margin-top: 2rem;
}

.temtems-section h2 {
    margin-bottom: 1rem;
}

.battle-matchups {
    margin-top: 2rem;
}

.battle-matchups h2 {
    margin-bottom: 1rem;
}

.matchup-section {
    background-color: #212121;
    border-radius: 8px;
    margin-bottom: 2rem;
    padding: 1rem;
}

.matchup-section h3 {
    color: #fff;
    padding: 0.75rem 1rem 0.75rem 0;
    margin: 0 0 0.5rem 0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

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

.matchup-type {
    background-color: #D9D9D9;
    border-radius: 20px;
    color: #000;
    padding: clamp(0.3rem, 0.8vw, 0.6rem) clamp(0.6rem, 1.2vw, 1rem);
    font-size: 1rem;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    min-width: 8.35rem;
}

#weak-to .matchup-type {
    background-color: rgba(255, 107, 107, .20);
    border: 2px solid rgba(255, 107, 107, .40);
    color: #FF9999;
}

#resistant-to .matchup-type {
    background-color: rgba(78, 205, 196, .20);;
    border: 2px solid rgba(78, 205, 196, .40);;
    color: #7DD3C0;
}

/* Multiplier display styling */
.multiplier {
    font-size: 0.75rem;
    font-weight: 400;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    display: inline-block;
    min-width: 0.9rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced weakness styling */
#weak-to .matchup-type.super-effective {
    background-color: rgba(255, 61, 61, 0.30);
    border: 2px solid rgba(255, 61, 61, 0.60);
    color: #FF6B6B;
    box-shadow: 0 0 10px rgba(255, 61, 61, 1);
}

#weak-to .matchup-type.super-effective .multiplier {
    background: rgba(255, 61, 61, 0.8);
    color: white;
    border: 2px solid rgba(255, 61, 61, 1);
    font-weight: 600;
}

#weak-to .matchup-type.effective {
    background-color: rgba(255, 107, 107, 0.20);
    border: 2px solid rgba(255, 107, 107, 0.40);
    color: #FF9999;
}

#weak-to .matchup-type.effective .multiplier {
    background: rgba(255, 107, 107, 0.6);
    color: white;
    border: 2px rgba(255, 107, 107, 0.8);
}

/* Enhanced resistance styling */
#resistant-to .matchup-type.super-resistant {
    background-color: rgba(46, 160, 150, 0.30);
    border: 2px solid rgba(46, 160, 150, 0.60);
    color: #4ECDC4;
    box-shadow: 0 0 10px rgba(46, 160, 150, 1);
}

#resistant-to .matchup-type.super-resistant .multiplier {
    background: rgba(46, 160, 150, 0.8);
    color: white;
    border: 2px solid rgba(46, 160, 150, 1);
    font-weight: 600;
}

#resistant-to .matchup-type.resistant {
    background-color: rgba(78, 205, 196, 0.20);
    border: 2px solid rgba(78, 205, 196, 0.40);
    color: #7DD3C0;
}

#resistant-to .matchup-type.resistant .multiplier {
    background: rgba(78, 205, 196, 0.6);
    color: white;
    border: 2px solid rgba(78, 205, 196, 0.8);
}

/* Add some spacing for the multiplier */
.matchup-type p {
    margin-right: 5px;
}

.matchup-type .type-image-container {
    width: 24px;
    height: 24px;
}

.matchup-type p {
    margin: 0;
}

.no-matchups {
    color: #aaa;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 1rem;
}

.evolution-section {
    margin-top: 2rem;
}

.evolution-section h2 {
    margin-bottom: 1rem;
}

#evolution-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.evolution-stage {
    flex: 1 1 200px;
    min-width: 0;
    box-sizing: border-box;
}

.evolution-arrow {
    flex: 0 0 auto;
}

.evolution-stage {
    background-color: #212121;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.3s;
}

.evolution-stage:hover {
    background-color: #444;
}

.evolution-stage.current {
    border: 2px solid #4ECDC4;
    box-shadow: 0 0 10px 2px #4ECDC4;
}

.evolution-image-container {
    width: 100px;
    height: 100px;
    position: relative;
    flex-shrink: 0;
}

.evolution-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.current-badge {
    position: absolute;
    top: -25px;
    right: -8px;
    background-color: #4ECDC4;
    color: #000;
    font-size: clamp(9px, 1.2vw, 12px);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.evolution-info {
    flex: 1;
    min-width: 0;
}

.evolution-name {
    font-size: clamp(1rem, 2.5vw, 22px);
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

.evolution-stage-text {
    font-size: 0.9rem;
    color: #aaa;
    font-family: 'Inter', sans-serif;
    line-height: 1.3;
}

.evolution-arrow {
    rotate: -90deg;
    font-size: clamp(24px, 4vw, 36px);
    color: #aaa;
    font-weight: bold;
}

.no-evolution {
    color: #aaa;
    font-style: italic;
    text-align: center;
    margin: 0;
    font-size: 1rem;
}

.techniques-section {
    margin-top: 2rem;
}

.technique-source-section {
    margin-bottom: 1.5rem;
}

.technique-source-title {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.technique-list {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
    gap: 0.5rem;
}

.technique-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #212121;
    border-radius: 3px;
    border-left: 3px solid #4ECDC4;
}

.technique-name {
    font-weight: 500;
}

.technique-level {
    background: #4ECDC4;
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.no-techniques {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.temtem-item:hover, .dojo-item:hover {
    background-color: #444;
    cursor: pointer;
    transition: background-color 0.2s;
}

.evolution-stage[style*="cursor: pointer"]:hover {
    background-color: #444;
}

@media (min-width: 1200px) {
    .evolution-image-container {
        width: 120px;
        height: 120px;
    }
    
    .temtem-list, .dojo-list {
        display: grid;
        gap: 15px;
    }

    .temtem-list {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }

    .dojo-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .temtem-item, .dojo-item {
        padding: 1rem;
    }
    
    .evolution-arrow {
        font-size: 32px;
    }
    
    .matchup-types {
        justify-content: flex-start;
    }
    
    .matchup-type {
        font-size: 14px;
        padding: 0.5rem;
    }
}

@media (max-width: 1200px) {
    .evolution-image-container {
        height: 100px;
        width: 100px;
    }

    #evolution-chain {
        flex-direction: column;
        justify-content: center;
    }
    
    .evolution-stage {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .evolution-arrow {
        rotate: 0deg;
    }
    
    .evolution-name {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .back-button {
       font-size: 0.9rem;
       padding: 0.6rem 1rem;
       gap: 0.3rem;
       -webkit-font-smoothing: antialiased;
       -moz-osx-font-smoothing: grayscale;
    }
   
    .back-button .arrow {
       font-size: 1.1rem;
    }

    .current-badge {
        top: -23px;
    }
    
    .dojo-header .dojo-image-container, .temtem-header .temtem-image-container {
        width: 160px;
        height: 160px;
    }

    .temtem-image-container, .dojo-image-container {
        height: 120px;
        width: 120px;
    }
    
    .matchup-types {
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    .matchup-section {
        padding: 0.75rem;
    }

    .matchup-section h3 {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem 0.5rem 0;
    }
    
    .site-nav a {
        margin: 0.25rem;
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .evolution-image-container {
        height: 80px;
        width: 80px;
    }

    .temtem-item, .dojo-item {
        padding: 0.5rem;
    }

    .temtem-header, .dojo-header {
        gap: 0.75rem;
    }
    
    .temtem-header .temtem-image-container, .dojo-header .dojo-image-container,
    .temtem-image-container, .dojo-image-container {
        height: 120px;
        width: 120px;
        padding-right: 0.75rem;
    }

    .temtem-image-container, .dojo-image-container {
        height: 100px;
        width: 100px;
    }

    .type-image-container {
        height: 20px;
        width: 20px;
    }
    
    .matchup-type .type-image-container {
        height: 24px;
        width: 24px;
    }
    
    .back-button {
        font-size: 1rem;
        padding: 0.55rem 1.5rem;
    }
}