/* DANI'S Crochet Glossary - Complete CSS File */

/* Content wrapper */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search section - tips and search on same line */
.glossary-search {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin: 30px auto;
    max-width: 700px;
    position: relative;
}

/* Tips button - coral background */
.glossary-tips-btn {
    background: linear-gradient(135deg, var(--clr-coral), var(--clr-fuchsia));
    color: var(--clr-warm-white);
    padding: 12px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    border-radius: 6px;
    min-width: 140px;
    height: 45px;
    white-space: nowrap;
    flex-shrink: 0;
}

.glossary-tips-btn:hover,
.glossary-tips-btn.active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Tips dropdown content */
.glossary-tips-content {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px;
    background: rgba(248, 241, 227, 0.98);
    border: 2px solid var(--clr-coral);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.glossary-tips-content.hidden {
    display: none;
}

.glossary-tips-content p {
    margin-bottom: 10px;
    color: var(--clr-primary-dark);
}

.glossary-tips-content a {
    color: var(--clr-coral);
    text-decoration: none;
}

/* Search input */
.glossary-search-input {
    flex: 1;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid var(--clr-coral);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--clr-cream);
    font-size: 1rem;
    height: 45px;
}

.glossary-search-input::placeholder {
    color: rgba(246, 238, 220, 0.6);
}

/* Main content area with sidebar */
.glossary-content {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: flex-start;
}

/* Filter sidebar - vertical on left */
.glossary-filters {
    width: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Filter buttons */
.glossary-filter-btn {
    padding: 10px 25px;
    background: transparent;
    color: var(--clr-coral);
    border: 2px solid var(--clr-coral);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    min-width: 120px;
    white-space: nowrap;
}

.glossary-filter-btn.active {
    background: var(--clr-coral);
    color: var(--clr-warm-white);
}

.glossary-filter-btn:hover {
    background: var(--clr-fuchsia);
    color: var(--clr-warm-white);
    border-color: var(--clr-fuchsia);
}

/* Grid container with 3D effect */
.glossary-container {
    background: rgba(0, 56, 64, 0.5);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    min-height: 600px;
    position: relative;
}

/* Carousel navigation controls */
.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.nav-btn {
    background: var(--clr-coral);
    color: var(--clr-warm-white);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--clr-fuchsia);
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: rgba(255, 112, 162, 0.3);
    cursor: not-allowed;
    transform: none;
}

.page-info {
    color: var(--clr-cream);
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* Carousel grid container */
.glossary-terms {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    margin: 20px 0;
}

/* Terms grid layout - 4x2 cards */
#terms-grid,
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(4, 180px);
    grid-template-rows: repeat(2, 250px);
    gap: 15px;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
    transition: transform 0.5s ease;
}

/* Glossary card */
.glossary-card {
    width: 180px !important;
    height: 250px !important;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    background: transparent !important;
}

/* Card flipped state */
.glossary-card.flipped {
    transform: rotateY(180deg);
}

/* Card hover effect */
.glossary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Flipped card hover */
.glossary-card.flipped:hover {
    transform: rotateY(180deg) translateY(-5px);
}

/* Card faces */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Card front */
.card-front {
    background: var(--clr-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: rotateY(0deg);
}

/* Card back */
.card-back {
    background: var(--clr-cream);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    color: var(--clr-primary-dark) !important;
}

/* Front content - abbreviation only */
.front-abbr {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--clr-coral);
    margin-bottom: 15px;
}

/* Front content - symbol */
.front-symbol {
    font-size: 1.5rem;
    color: var(--clr-mauve);
}

/* Back content - name */
.back-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clr-primary-dark);
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Back content - description */
.back-description {
    font-size: 0.8rem;
    color: var(--clr-primary-dark);
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.3;
}

/* Back content - US/UK terms */
.back-terms {
    font-size: 0.75rem;
    color: var(--clr-primary-dark);
    margin-bottom: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.back-terms strong {
    color: var(--clr-primary-dark);
}

/* Loading and status messages */
#loading-message,
#error-message,
#no-results {
    text-align: center;
    padding: 40px;
    color: var(--clr-coral);
    font-size: 1.1rem;
}

#error-message,
#no-results {
    display: none;
}

/* Pagination navigation */
#pagination-nav {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#prevPage,
#nextPage,
#prev-btn,
#next-btn {
    background: linear-gradient(135deg, var(--clr-coral), var(--clr-fuchsia));
    color: var(--clr-warm-white);
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#prevPage:hover:not(:disabled),
#nextPage:hover:not(:disabled),
#prev-btn:hover:not(:disabled),
#next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#prevPage:disabled,
#nextPage:disabled,
#prev-btn:disabled,
#next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo,
#current-page,
#total-pages {
    color: var(--clr-coral);
    font-weight: 600;
}

/* Footer styling */
.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    color: var(--clr-cream);
}

.footer a {
    color: var(--clr-coral);
    text-decoration: none;
}

.footer a:hover {
    color: var(--clr-fuchsia);
}

/* Responsive - tablet */
@media (max-width: 768px) {
    .glossary-search {
        flex-direction: column;
        gap: 10px;
    }

    .glossary-tips-btn {
        width: 100%;
    }

    .glossary-search-input {
        width: 100%;
        max-width: none;
    }

    .glossary-content {
        flex-direction: column;
    }
    
    .glossary-filters {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .glossary-filter-btn {
        width: auto;
        min-width: 140px;
    }
    
    /* Mobile - 2x2 grid */
    .glossary-terms {
        padding: 10px 0;
    }
    
    #terms-grid,
    .glossary-grid {
        grid-template-columns: repeat(2, 150px);
        grid-template-rows: repeat(2, 220px);
        gap: 10px;
    }
    
    .glossary-card {
        width: 150px !important;
        height: 220px !important;
    }

    .glossary-container {
        width: 95%;
        padding: 15px;
    }
    
    /* Smaller fonts */
    .front-abbr {
        font-size: 2rem;
    }
    
    .back-name {
        font-size: 0.9rem;
    }
    
    .back-description {
        font-size: 0.75rem;
    }
}

/* Responsive - mobile */
@media (max-width: 480px) {
    #terms-grid,
    .glossary-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 200px);
        justify-items: center;
    }
    
    .glossary-card {
        width: 130px !important;
        height: 200px !important;
    }
    
    /* Smaller fonts */
    .front-abbr {
        font-size: 1.8rem;
    }
    
    .front-symbol {
        font-size: 1.2rem;
    }
    
    .back-name {
        font-size: 0.85rem;
    }
    
    .back-description {
        font-size: 0.75rem;
    }
    
    .back-terms {
        font-size: 0.7rem;
    }
}