/* ==========================
   GLOBAL STYLES
========================== */
body {
    font-family: Quicksand, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* ==========================
   FLASHCARD CONTAINER
========================== */
#flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================
   FLASHCARD DESIGN
========================== */
.flashcard {
    width: 100%;
    max-width: 1024px;
    height: 450px;
    margin-bottom: 10px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
}

.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border-radius: 12px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
    padding: 25px;
    overflow: auto;
    word-wrap: break-word;
    line-height: 1.6;
}

.flashcard-front {
    background: #ffffff;
    color: #000;
}

.flashcard-back {
    background: #c9c9c9;
    color: #000;
    transform: rotateY(180deg);
}

.flashcard-front img,
.flashcard-back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.flashcard-front > *,
.flashcard-back > * {
    margin: 0 auto;
}

/* ==========================
   EMBEDDED NAVIGATION ARROWS
========================== */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(44, 62, 80, 0.8);
    color: white;
    border: none;
    font-size: 28px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.3s ease;
}

.nav-arrow:hover {
    background-color: rgba(44, 62, 80, 1);
}

.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}

/* ==========================
   FLASHCARD CONTROLS (optional)
========================== */
.controls {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.controls button {
    background: #2c3e50;
    color: white;
    font-size: 18px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.controls button:hover {
    background: #34495e;
}

.controls button:focus {
    outline: none;
}

:fullscreen .controls,
:-webkit-full-screen .controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================
   FULLSCREEN BEHAVIOR
========================== */
:fullscreen .flashcard,
:-webkit-full-screen .flashcard {
    width: 100vw;
    height: 100vh;
    font-size: 28px;
}

:fullscreen .adsbygoogle,
:-webkit-full-screen .adsbygoogle,
:fullscreen .google-auto-placed,
:-webkit-full-screen .google-auto-placed {
    display: none !important;
}

/* ==========================
   INLINE FLASHCARD & AD BLOCK
========================== */
.flashcard-item {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.flashcard-ad {
    margin: 30px auto;
    text-align: center;
    max-width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

/* ==========================
   FLASHCARD SET GRID & ITEMS
========================== */
.flashcard-set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px auto;
    max-width: 1200px;
    padding: 20px;
}

.flashcard-set-item {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.3s ease-in-out;
}

.flashcard-set-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.flashcard-set-item h3,
.flashcard-set-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.flashcard-set-item p {
    font-size: 15px;
    color: #444;
    margin-bottom: 8px;
}

.flashcard-set-item .view-set,
.view-set {
    background: #007BFF;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    transition: background 0.3s ease;
}

.view-set:hover {
    background: #0056b3;
}

/* ==========================
   FLASHCARD CATEGORY GRID
========================== */
.flashcard-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

.flashcard-category-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.3s ease-in-out;
}

.flashcard-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.flashcard-category-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #222;
}

.flashcard-category-card p {
    font-size: 14px;
    margin: 5px 0;
    color: #666;
}

.flashcard-category-card a {
    text-decoration: none;
    color: inherit;
}

/* ==========================
   PAGINATION
========================== */
.pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination li {
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 8px 14px;
    font-size: 15px;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination li a:hover,
.pagination li span.current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* ==========================
   RESPONSIVE DESIGN
========================== */
@media (max-width: 1024px) {
    .flashcard {
        width: 90%;
        height: 400px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .flashcard {
        width: 95%;
        height: 350px;
        padding: 18px;
        margin-bottom: 20px;
    }

    .flashcard-front,
    .flashcard-back {
        font-size: 20px;
        padding: 20px;
    }

    .flashcard-set-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .controls button {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    #flashcard-container {
        padding-bottom: 0;
    }

    .flashcard {
        width: 100%;
        height: 320px;
        padding: 15px;
        margin-bottom: 0;
    }

    .flashcard-front,
    .flashcard-back {
        font-size: 18px;
        padding: 15px;
    }

    .controls {
        margin-bottom: 0;
    }
}
