/* ===== WARM, WELCOMING APPEARANCE ===== */

body {
    background-color: #fdf8f3;
}

.md-content {
    background-color: #fffefb;
    border-radius: 12px;
    padding: 2rem;
}

h1 {
    color: #4682b4;
    border-bottom: 3px solid #81c4e8;
    padding-bottom: 0.5rem;
}

h2 {
    color: #5a8bb8;
    margin-top: 2rem;
}

h3 {
    color: #6b8e9e;
}

a {
    color: #4a9cd6;
}

a:hover {
    color: #3182bd;
}

/* ===== ADMONITIONS - SAME FONT SIZE AS BODY ===== */

.md-typeset .admonition {
    border-left: 4px solid;
    border-radius: 8px;
    background: #fdfcfa;
    font-size: inherit !important;
}

.md-typeset .admonition-title {
    font-size: inherit !important;
}

.md-typeset .admonition p {
    font-size: inherit !important;
}

.md-typeset .admonition.tip {
    border-color: #ffc107;
}

.md-typeset .admonition.info {
    border-color: #4a9cd6;
}

.md-typeset .admonition.example {
    border-color: #81c4e8;
    background: #f0f9ff;
}

.md-typeset .admonition.example table {
    font-size: 1.15rem !important;
}

.md-typeset .admonition.example td,
.md-typeset .admonition.example th {
    font-size: 1.15rem !important;
    padding: 0.9rem 1.2rem !important;
}

.md-typeset .admonition.question {
    border-color: #ffc107;
    background: #fffbf0;
}

.md-typeset .admonition.question .admonition-title {
    background-color: rgba(255, 193, 7, 0.1);
}

.md-typeset .admonition.question > .admonition-title::before {
    background-color: #ffc107;
}

/* ===== MATCHING GAME STYLES - COMPACT ===== */

.matching-game {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    margin: 1.5rem 0;
    max-width: 700px;
}

.matching-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;  /* Reduced from 0.75rem */
}

.matching-column h3 {
    text-align: center;
    margin-bottom: 0.5rem;  /* Reduced from 1rem */
    color: #4a9cd6;
    font-weight: 500;
    font-size: 0.95rem;  /* Smaller header */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matching-item {
    padding: 0.6rem 0.8rem;  /* Reduced from 1.1rem */
    background: #ffffff;
    border: 2px solid #e8f4f8;
    border-radius: 8px;  /* Slightly less rounded */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.05rem;  /* Reduced from 1.1rem but still larger than body text */
    font-weight: 400;
    box-shadow: 0 1px 3px rgba(74, 156, 214, 0.08);
}

.matching-item:hover {
    background: #e3f2fd;
    border-color: #4a9cd6;
    transform: translateY(-1px);  /* Less movement */
    box-shadow: 0 3px 8px rgba(74, 156, 214, 0.2);
}

.matching-item.selected {
    background: #bbdefb;
    border-color: #4a9cd6;
    border-width: 3px;
    box-shadow: 0 3px 8px rgba(74, 156, 214, 0.3);
}

.matching-item.correct {
    background: #c8e6c9;
    border-color: #66bb6a;
    cursor: default;
    animation: correctPulse 0.5s ease;
    box-shadow: 0 3px 8px rgba(102, 187, 106, 0.3);
}

.matching-item.correct:hover {
    transform: none;
    background: #c8e6c9;
    border-color: #66bb6a;
}

.matching-item.incorrect {
    background: #bdbdbd;
    border-color: #757575;
    animation: shake 0.5s ease;
    pointer-events: none;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.game-status {
    text-align: center;
    margin-top: 1rem;  /* Reduced from 2rem */
}

.game-status p {
    font-size: 1rem;  /* Reduced from 1.2rem */
    font-weight: 500;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
    color: #5a8bb8;
}

/* ===== BUTTONS ===== */

.md-button {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
}

.md-button--primary {
    background-color: #4a9cd6 !important;
    box-shadow: 0 2px 8px rgba(74, 156, 214, 0.2);
}

.md-button--primary:hover {
    background-color: #3182bd !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 156, 214, 0.4);
}

button[onclick] {
    background: #ffc107 !important;
    color: #1a1a1a !important;
    border-radius: 8px;
    font-size: 1rem !important;
}

button[onclick]:hover {
    background: #ffa000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

/* ===== TABLES ===== */

table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

th {
    background: #e3f2fd;
    color: #3182bd;
    font-weight: 600;
}

tr:hover {
    background: #fdf8f3;
}

/* ===== CODE BLOCKS ===== */

code {
    background: #f0f9ff;
    border: 1px solid #d3e8f7;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

pre code {
    background: #f8fbfd;
    border: 1px solid #e3f2fd;
    border-radius: 8px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .matching-game {
        flex-direction: column;
        gap: 1rem;
    }
    
    .matching-column {
        width: 100%;
    }
    
    .md-content {
        padding: 1rem;
    }
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */

.md-content {
    animation: fadeIn 0.3s ease-in;
}

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

/* ===== PROFESSIONAL POLISH ===== */

.md-typeset .grid.cards > ul > li {
    border: 1px solid #e8f4f8;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.md-typeset .grid.cards > ul > li:hover {
    border-color: #4a9cd6;
    box-shadow: 0 4px 12px rgba(74, 156, 214, 0.15);
    transform: translateY(-2px);
}

::selection {
    background: #bbdefb;
    color: #1a1a1a;
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .matching-item {
    background: #2e3440;
    border-color: #4c566a;
}

[data-md-color-scheme="slate"] .matching-item:hover {
    background: #3b4252;
    border-color: #5e81ac;
}

[data-md-color-scheme="slate"] body {
    background: #2e3440;
}

[data-md-color-scheme="slate"] .md-content {
    background: #3b4252;
}

.md-nav--primary {
    display: block !important;
}