/* =============================================
   1. Main Page Layout
   ============================================= */

/* Override body background for cosmic background pages */
body {
    background-color: transparent !important;
    background-image: none !important;
}

/* === PAGE ELEMENT ANIMATIONS - DOMINO EFFECT === */
/* All elements start hidden and animate in with domino effect */
#main-nav,
#page-wrapper,
.guides-container,
.page-header,
.featured-guide-container,
.guide-category-card {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-nav.visible,
#page-wrapper.visible,
.guides-container.visible,
.page-header.visible,
.featured-guide-container.visible,
.guide-category-card.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.guides-container {
    max-width: 75rem; /* Increased max-width */
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.guides-header-container {
    margin-bottom: 3rem;
}

.page-header {
    text-align: center;
    padding: 2rem 1rem;
}

.page-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem; /* Increased font size */
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    text-shadow: 0.125rem 0.125rem 0.5rem rgba(0,0,0,0.8);
}

.page-header p {
    font-size: 1.1rem;
    color: #c9d1d9;
    max-width: 37.5rem;
    margin: 0 auto;
    text-shadow: 1px 1px 0.25rem rgba(0,0,0,0.7);
}

/* =============================================
   2. Action Buttons
   ============================================= */
.guides-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.guides-actions .btn-primary {
    background: linear-gradient(145deg, #58a6ff, #388bfd);
    border: 1px solid #58a6ff;
    box-shadow: 0 0.25rem 1.25rem rgba(88, 166, 255, 0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* =============================================
   3. Guide Card Styling
   ============================================= */

.guide-card {
    background: linear-gradient(145deg, #1a2028, #161b22);
    border-radius: 0.625rem;
    border: 1px solid #30363d;
    text-decoration: none;
    color: #c9d1d9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-0.5rem) scale(1.02);
    box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(88, 166, 255, 0.15);
    border-color: #58a6ff;
}

.guide-card-thumbnail {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.guide-character-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.guide-card:hover .guide-character-icon {
    transform: scale(1.1);
}

.guide-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Makes card content fill the space */
}

.guide-title-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    flex-grow: 1; /* Pushes author/meta to bottom */
}

.guide-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.guide-author-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
}

.guide-author-name {
    font-size: 0.85rem;
    color: #c9d1d9;
    font-weight: 500;
}

.guide-card-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #8b949e;
    padding-top: 0.75rem;
    border-top: 1px solid #30363d;
}

.guide-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.guide-stat i {
    font-size: 0.9rem;
}

.guide-row-placeholder {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: #8b949e;
    font-style: italic;
    grid-column: 1 / -1; /* Span full width */
}


/* =============================================
   4. Category Card Styling
   ============================================= */
#category-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
    gap: 1.5rem;
}

.guide-category-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.625rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column; /* Changed to column */
    align-items: center; /* Center items */
    text-align: center; /* Center text */
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.guide-category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0) 70%);
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    transform: scale(0);
}

.guide-category-card:hover {
    transform: translateY(-0.3125rem);
    background: #1a2028;
    box-shadow: 0 0.625rem 1.25rem rgba(0,0,0,0.2), 0 0 0.9375rem rgba(88, 166, 255, 0.1);
}

.guide-category-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.card-icon {
    flex-shrink: 0;
    font-size: 2.5rem; /* Increased size */
    color: #58a6ff;
    width: auto; /* Removed fixed width */
    text-align: center;
    margin-bottom: 0.5rem; /* Added margin */
    z-index: 1;
}

.card-content {
    flex-grow: 1;
}

.card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #f0f6fc;
    font-weight: 600;
}

.card-description {
    margin: 0;
    font-size: 0.9rem;
    color: #8b949e;
    line-height: 1.5;
}

/* =============================================
   5. Guide List View Styling
   ============================================= */
.btn-back {
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

#guide-list-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
}



/* =============================================
   6. Loading Spinner
   ============================================= */
#guides-loader {
    border: 0.25rem solid #30363d;
    border-top: 0.25rem solid #58a6ff;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 1s linear infinite;
    margin: 4rem auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   5. Responsive Design
   ============================================= */
@media (max-width: 48rem) {
    .guide-stats, .guide-last-updated {
        display: none;
    }
    .guide-row {
        gap: 1rem;
    }
    .guide-icon-container {
        width: 2.5rem;
        height: 2.5rem;
    }
}
body {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a2028' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* =============================================
   1. Header Enhancements
   ============================================= */

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.page-header {
    background: linear-gradient(rgba(13, 17, 23, 0.8), rgba(13, 17, 23, 1)), url(../images/maps/celestial-husk.png) no-repeat center center;
    background-size: cover;
    border: none;
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.5);
    padding: 4rem 1rem; /* Increased padding */
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(13, 17, 23, 0.7) 0%, rgba(13, 17, 23, 0) 50%);
    z-index: 1;
}

.page-header h1, .page-header p, .page-header .guides-actions {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 0.125rem;
}

.page-header p {
    font-size: 1.2rem;
    color: #a5b3c2;
}

/* =============================================
   2. Category Card Enhancements
   ============================================= */

.guide-category-card {
    background: linear-gradient(145deg, #1a2028, #161b22);
    border: 1px solid #30363d;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.guide-category-card:hover {
    transform: translateY(-0.5rem) scale(1.02);
    box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(88, 166, 255, 0.15);
    border-color: #58a6ff;
}

.card-icon {
    transition: transform 0.3s ease;
}

.guide-category-card:hover .card-icon {
    transform: scale(1.1);
}

.guide-category-card[data-category="character-guides"]:hover { border-color: #e53935; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(229, 57, 53, 0.2); }
.guide-category-card[data-category="map-strategies"]:hover { border-color: #43a047; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(67, 160, 71, 0.2); }
.guide-category-card[data-category="team-synergies"]:hover { border-color: #1e88e5; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(30, 136, 229, 0.2); }
.guide-category-card[data-category="beginner-basics"]:hover { border-color: #fdd835; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(253, 216, 53, 0.2); }
.guide-category-card[data-category="advanced-techniques"]:hover { border-color: #fb8c00; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(251, 140, 0, 0.2); }
.guide-category-card[data-category="game-modes"]:hover { border-color: #8e24aa; box-shadow: 0 0.9375rem 1.5625rem rgba(0,0,0,0.3), 0 0 1.25rem rgba(142, 36, 170, 0.2); }

/* =============================================
   3. Guide List Refinements
   ============================================= */

#guide-list-view {
    padding: 2rem;
    background-color: #0d1117;
    border-radius: 0.625rem;
    border: 1px solid #30363d;
}

#guide-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Small gap between rows */
}

/* New Guide List Row Styles */
.guide-list-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(145deg, #1a2028, #161b22);
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #c9d1d9;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.guide-list-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.25);
    border-color: #58a6ff;
    background-color: #1f252e;
}

.guide-list-row__thumbnail {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    margin-right: 1rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.guide-list-row__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-list-row__main-info {
    flex-grow: 1;
}

.guide-list-row__main-info .guide-title-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0 0 0.25rem 0;
}

.guide-list-row__main-info .guide-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.guide-list-row__metadata {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
    color: #8b949e;
    font-size: 0.9rem;
}

.guide-list-row .guide-stat {
    min-width: 4.375rem; /* 70px */
}


/* Remove old card styles */
.guide-card {
    display: none; /* Hide old cards if they ever appear */
}


/* =============================================
   4. Featured Guide Section
   ============================================= */

.featured-guide-container {
    margin-bottom: 4rem;
}

.featured-guide-card {
    display: flex;
    background: linear-gradient(145deg, #1f252e, #161b22);
    border-radius: 0.75rem;
    border: 1px solid #30363d;
    overflow: hidden;
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.featured-guide-card:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.9375rem 2.1875rem rgba(0,0,0,0.5), 0 0 1.5625rem rgba(88, 166, 255, 0.1);
    border-color: #58a6ff;
}

.featured-guide-thumbnail {
    flex: 0 0 18.75rem;
    background-size: cover;
    background-position: center;
    min-height: 12.5rem;
}

.featured-guide-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.featured-guide-content h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #f0f6fc;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.featured-guide-meta {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 1rem;
}

.featured-guide-excerpt {
    font-size: 1rem;
    color: #c9d1d9;
    line-height: 1.6;
    flex-grow: 1;
}

.featured-guide-cta {
    margin-top: 1.5rem;
    font-weight: 700;
    color: #58a6ff;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-guide-cta i {
    transition: transform 0.2s ease;
}

.featured-guide-card:hover .featured-guide-cta i {
    transform: translateX(0.25rem);
}

/* =============================================
   5. Responsive Design
   ============================================= */

@media (max-width: 48rem) {
    .page-header {
        padding: 3rem 1rem;
    }
    .page-header h1 {
        font-size: 3.5rem;
    }
    .page-header p {
        font-size: 1rem;
    }

    .featured-guide-card {
        flex-direction: column;
    }

    .featured-guide-thumbnail {
        flex-basis: 12.5rem; /* Set a fixed height for the thumbnail on mobile */
    }

    .featured-guide-content {
        padding: 1.5rem;
    }

    #guide-list-view {
        padding: 1rem;
    }
}

/* =============================================
   6. Guide List Controls
   ============================================= */

.guide-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    flex-grow: 1;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    color: #c9d1d9;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#search-input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.9rem;
    color: #8b949e;
}

#sort-select {
    padding: 0.75rem 1rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    color: #c9d1d9;
    font-size: 1rem;
}
