/* 만다라트 공통 스타일 */
.wp-mandalart {
    --mandalart-bg: #ffffff;
    --mandalart-border: #dee2e6;
    --mandalart-text: #495057;
    --mandalart-center-bg: #e9ecef;
    --mandalart-center-border: #adb5bd;
    --mandalart-hover-shadow: rgba(0, 0, 0, 0.15);
}

.wp-mandalart.dark-mode {
    --mandalart-bg: #343a40;
    --mandalart-border: #495057;
    --mandalart-text: #e9ecef;
    --mandalart-center-bg: #495057;
    --mandalart-center-border: #6c757d;
    --mandalart-hover-shadow: rgba(0, 0, 0, 0.3);
}

/* 그리드 레이아웃 */
.mandalart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    aspect-ratio: 1;
    max-width: 800px;
    margin: 0 auto;
}

/* 셀 스타일 */
.mandalart-cell {
    position: relative;
    background-color: var(--mandalart-bg);
    border: 1px solid var(--mandalart-border);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.mandalart-cell::before {
    content: '';
    display: block;
    padding-top: 100%;
}

.mandalart-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1rem var(--mandalart-hover-shadow);
    z-index: 1;
}

/* 중앙 셀 스타일 */
.mandalart-cell[data-index="4"] {
    background-color: var(--mandalart-center-bg);
    border-color: var(--mandalart-center-border);
}

/* 셀 내용 */
.cell-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--mandalart-text);
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mandalart-cell {
    animation: fadeIn 0.3s ease-out forwards;
}

.mandalart-cell:nth-child(1) { animation-delay: 0s; }
.mandalart-cell:nth-child(2) { animation-delay: 0.1s; }
.mandalart-cell:nth-child(3) { animation-delay: 0.2s; }
.mandalart-cell:nth-child(4) { animation-delay: 0.1s; }
.mandalart-cell:nth-child(5) { animation-delay: 0.2s; }
.mandalart-cell:nth-child(6) { animation-delay: 0.3s; }
.mandalart-cell:nth-child(7) { animation-delay: 0.2s; }
.mandalart-cell:nth-child(8) { animation-delay: 0.3s; }
.mandalart-cell:nth-child(9) { animation-delay: 0.4s; }

/* 반응형 스타일 */
@media (max-width: 768px) {
    .mandalart-grid {
        gap: 0.5rem;
    }
    
    .cell-content {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* 다크 모드 토글 버튼 */
.dark-mode-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--mandalart-bg);
    border: 1px solid var(--mandalart-border);
    color: var(--mandalart-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    z-index: 100;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.5rem var(--mandalart-hover-shadow);
}

.wp-mandalart-chart {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.mandalart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mandalart-cell {
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mandalart-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.mandalart-cell.has-sub-items {
    background: #f8f9fa;
}

.mandalart-cell.has-sub-items:after {
    content: "+";
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    color: #666;
}

.mandalart-cell.center {
    background: #e9ecef;
    font-weight: bold;
}

.mandalart-sub-grid {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mandalart-sub-grid.active {
    display: block;
}

.mandalart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mandalart-overlay.active {
    display: block;
}

.close-sub-grid {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.close-sub-grid:hover {
    color: #dc3232;
}

@media (max-width: 600px) {
    .wp-mandalart-chart {
        padding: 10px;
    }

    .mandalart-grid {
        gap: 5px;
    }

    .mandalart-cell {
        padding: 5px;
        font-size: 14px;
    }
} 