:root {
    --primary-color: #4a6baf;
    --secondary-color: #ff7979;
    --accent-color: #ffbe76;
    --background-color: #f5f6fa;
    --success-color: #6ab04c;
    --border-color: #dfe4ea;
    --text-color: #2f3542;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-family: 'Comic Neue', cursive;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #3a5a9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#download-btn {
    background-color: var(--success-color);
    transform: rotate(-3deg);
}

#download-btn:hover {
    background-color: #5a9f3c;
}

.a4-page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.worksheet-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--border-color);
}

.worksheet-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.student-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.info-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 45%;
}

.info-field label {
    font-weight: bold;
}

.line {
    flex-grow: 1;
    height: 1px;
    border-bottom: 2px solid var(--border-color);
}

#activities-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Activity styles */
.activity {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 0px;
    background-color: #fff;
}

.activity-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 5px;
}

.activity-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Specific activity styles */
.letter-tracing, .number-tracing {
    font-family: 'Comic Neue', cursive;
    font-size: 3rem;
    color: #ccc;
    background-color: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 8px;
    letter-spacing: 15px;
}

.matching {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.matching-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* New matching activity styles */
.matching-activity {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    background-color: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 8px;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 45%;
}

.matching-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    border-radius: 8px;
    font-size: 2rem;
    height: 60px;
}

.left-item {
    background-color: rgba(74, 107, 175, 0.1);
    border: 2px solid var(--primary-color);
}

.right-item {
    background-color: rgba(255, 121, 121, 0.1);
    border: 2px solid var(--secondary-color);
}

/* Style for emoji groups in the number matching activity */
.emoji-group {
    font-size: 1.25rem;
}

.counting-item, .sorting-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.counting-item {
    border: 2px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 4px;
    min-width: 80px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji {
    font-size: 2rem;
}

.big-emoji {
    font-size: 3rem;
}

.circle-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 0px;
}

.maze-container {
    width: 100%;
    height: 180px;
    border: 2px solid var(--border-color);
    position: relative;
}

.dots-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    gap: 15px;
}

.dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}

.pattern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pattern .emoji {
    font-size: 2.5rem;
}

.pattern .missing {
    width: 50px;
    height: 50px;
    border: 2px dashed var(--secondary-color);
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .a4-page {
        width: 100%;
        padding: 15px;
    }
    
    #activities-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .sticker-controls {
        top: 5px;
        right: 10px;
        gap: 8px;
    }
    
    .sticker-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .sticker-label {
        font-size: 0.6rem;
        padding: 0px 4px;
    }
}

.dot-to-dot-container {
    width: 100%;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot-to-dot-svg {
    width: 100%;
    height: 100%;
    max-width: 180px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.dot-circle {
    fill: var(--secondary-color);
    stroke: white;
    stroke-width: 1;
}

.dot-number {
    fill: white;
    font-size: 8px;
    font-weight: bold;
    user-select: none;
}

.dot-group:hover .dot-circle {
    fill: var(--primary-color);
    r: 4;
}

.sticker-controls {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.sticker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sticker-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-color);
    background-color: white;
    padding: 1px 6px;
    border-radius: 8px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    border: 1px dashed var(--border-color);
}

.sticker-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    background-color: white;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 5;
}

.sticker-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 5%, transparent 50%);
    pointer-events: none;
}

.sticker-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 8px;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0 0 50% 50%;
}

.sticker-btn:hover {
    transform: rotate(-5deg) scale(1.1) !important;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
}

.sticker-btn:active {
    transform: scale(0.95) !important;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

#generate-btn {
    background-color: var(--accent-color);
    transform: rotate(7deg);
}

/* Print styles */
@media print {
    body {
        padding: 0;
        background: none;
    }
    
    .container {
        max-width: none;
    }
    
    .a4-page {
        box-shadow: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .sticker-controls {
        display: none !important;
    }
    
    #activities-container {
        break-inside: avoid;
    }
    
    .activity {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
